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可以多个
原文地址:https://www.cnblogs.com/mengfangui/p/9195783.html
时间: 2024-10-05 23:25:45