Open LengYXin opened 3 years ago
8.0.0-rc.1 vue3 extends Cannot inherit lifecycle invalid code @Options({ components: {}, }) export default class extends Vue { created() {} mounted() { console.error("啊啊啊啊啊"); } updated() {} destroyed() {} }
Effective code export default { created() {}, mounted() { console.error("啊啊啊啊啊"); }, };
defineComponent({extends:component}) 在使用 extends 组件的时候 class 组件不会继承 生命周期 查看原因是 生命周期在 prototype 中 translate When using the extensions component, the class component does not inherit the lifecycle view because the lifecycle is in prototype
Sorry, I can't speak English
8.0.0-rc.1 vue3 extends Cannot inherit lifecycle invalid code @Options({ components: {}, }) export default class extends Vue { created() {} mounted() { console.error("啊啊啊啊啊"); } updated() {} destroyed() {} }
Effective code export default { created() {}, mounted() { console.error("啊啊啊啊啊"); }, };
defineComponent({extends:component}) 在使用 extends 组件的时候 class 组件不会继承 生命周期 查看原因是 生命周期在 prototype 中 translate When using the extensions component, the class component does not inherit the lifecycle view because the lifecycle is in prototype
Sorry, I can't speak English