Vue组件继承
========
import Vue from ‘vue’
const compoent = {
props: {
active: Boolean,
propOne: String
},
template: `
see me if active
`,
data () {
return {
text: 0
}
},
mounted () {
console.log(‘compoent1 comp mounted’)
},
methods: {
handleChange () {
this.$emit(‘change’)
}
}
}
const componet2 = {
extends: compoent, // 继承compoent
data () {
return {
text: 1
}
},
mounted () {
console.log(‘componet2’, this. p a r e n t . parent. parent.options.name)
}
}
// const CompVue = Vue.extend(compoent)
// new C