You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use the @Options({ props: ... }) syntax currently generated by vue-cli, the component props are correctly populated by element attributes. When I use the extends Vue.with(Props) syntax, the component props are not populated.
Repro:
I used [email protected] with Vue3, babel, typescript, and eslint support to generate a new project.
This works just fine. The attribute value is correctly displayed in the <h1> element inside the component. I'm not sure why the generated class defines msg as both a prop and data, though.
If I change the component to use the new prop syntax (and comment out the data property), like this:
class Props {
msg!: string
}
export default class HelloWorld extends Vue.with(Props) {
//msg!: string
}
The app compiles and loads just fine, but the prop is no longer populated by the element attribute.
This test case suggests this should work, so I'm not sure what's broken:
When I use the
@Options({ props: ... })
syntax currently generated by vue-cli, the component props are correctly populated by element attributes. When I use theextends Vue.with(Props)
syntax, the component props are not populated.Repro:
I used [email protected] with Vue3, babel, typescript, and eslint support to generate a new project.
Dependencies added include:
HelloWorld.vue (minus some fluff) looks like this:
App.vue uses the component like this:
This works just fine. The attribute value is correctly displayed in the
<h1>
element inside the component. I'm not sure why the generated class definesmsg
as both a prop and data, though.If I change the component to use the new prop syntax (and comment out the data property), like this:
The app compiles and loads just fine, but the prop is no longer populated by the element attribute.
This test case suggests this should work, so I'm not sure what's broken:
vue-class-component/test/specs/test.spec.ts
Line 390 in 4ccce3f
Changing the dependency version to
8.0.0-rc.1
did not affect the behavior.The text was updated successfully, but these errors were encountered: