Skip to content

Commit

Permalink
fix(plugin-vue): use __vccOpts for vue-class-component (#5374)
Browse files Browse the repository at this point in the history
  • Loading branch information
borkeszmate authored Nov 9, 2021
1 parent 03b77bd commit c4f9db2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/plugin-vue/src/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ export const EXPORT_HELPER_ID = 'plugin-vue:export-helper'

export const helperCode = `
export default (sfc, props) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props) {
sfc[key] = val
target[key] = val;
}
return sfc
return target;
}
`

2 comments on commit c4f9db2

@jimhucksly
Copy link

@jimhucksly jimhucksly commented on c4f9db2 Nov 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot read property '__vccOpts' of undefined
https://gitlab.com/jimhucksly/pitertour/-/tree/master

@patak-dev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jimhucksly please create an issue with a minimal reproduction. Thanks!

Please sign in to comment.