const mixins = {
created () {
console.log('mixins created')
}
}
const mixins2 = {
created () {
console.log('mixins2 created')
}
}
const extend = {
created () {
console.log('extends created')
}
}
export default {
mixins: [mixins, mixins2],
extends: extend,
created () {
console.log('组件 created')
}
}
控制台输出:
extends只能继承一个
mixins可以多个