Skip to content

Commit

Permalink
(plugin-vue):vue-class-component fix. helper.ts use sfc.__vccOpts
Browse files Browse the repository at this point in the history
  • Loading branch information
Máté Borkesz committed Nov 9, 2021
1 parent b1f87fd commit e1db621
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/plugin-vue/src/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ export const EXPORT_HELPER_ID = 'plugin-vue:export-helper'
export const helperCode = `
export default (sfc, props) => {
if (!sfc || typeof sfc !== 'object') {
sfc = {};
}
const target = sfc.__vccOpts || sfc
for (const [key, val] of props) {
sfc[key] = val
target[key] = val
}
return sfc;
return target
}
`

0 comments on commit e1db621

Please sign in to comment.