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')