组件循环嵌套引用时会报错:Unknown custom element: <组件名> - did you register the component correctly?
解决办法:
beforeCreate() {
this.$options.components.组件名称 = require('组件引用地址').default
}
例如:
html:
<MenuData ref="MenuData" :canvas="canvas" :flag="false" />
JS:
beforeCreate () {
this.$options.components.MenuData = require('./components/MenuData').default
},
网友评论