参考视频例子为什么打印两次parents created
来源:3-7 合并配置(下)

慕娘6538821
2019-09-15
如题
写回答
2回答
-
贴一下你的代码?
012019-09-16 -
慕娘6538821
提问者
2019-09-16
let childComp = { template: '<div>{{msg}}</div>', // 子组件 created() { console.log('child created') }, mounted() { console.log('child mounted') }, data() { return { msg: 'Hello Child' } }, } Vue.mixin({ created() { console.log('parents created'); } }) new Vue({ render: h => h(childComp), }).$mount('#app')
012019-09-16
相似问题