-
Notifications
You must be signed in to change notification settings - Fork 433
init data by access props is undefinded #619
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I've also run into this issue when updating to the latest versions. It seems to be related with dev-deps, because when we left that untouched, it works just fine. We're still trying to figure this one out and see which dep causes this behavior. |
Just had this issue. Downgrading to TypeScript 4.2.4 fixed it. |
Does anyone has a workaround for this that does not involve downgrading Typescript? We can't downgrade our typescript version and we haven't found a way to solve this issue. |
I decide rewrite all class component using composition api |
Added in tsconfig.json, now its working fine for me tested on typescript v. 4.7.4 |
@farazshuja really appreciate your comment help me fixing my legacy project! |
I'm not sure but it seems that putting the props definition after the data definition also work for me. Can anyone confirm or explain why ? Sorry I'm not typescript fluent. <template>
<span>{{ test }}-{{ local }}</span>
</template>
<script>
import { Component, Prop, Vue } from 'vue-property-decorator';
@Component
export default class HelloWorld extends Vue {
/* data first */
local = JSON.parse(JSON.stringify(this.msg));
@Prop({default: ()=>({aaa: 456})}) msg;
get test() {
return this.msg.aaa;
}
}
</script> |
code example:
this code is works in lower version. recent days,i want to upgrade my dependencies, but get problems with this code.
The text was updated successfully, but these errors were encountered: