Vue中组件递归嵌套报错解决

2024-05-07  本文已影响0人  FrankFang7

[Vue warn]: Unknown custom element: <TreeNode> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

递归式引用组件,比如A组件引用B组件,B组件引用C组件,C组件又引用A组件之类的
解决方案是,将import引入改为components内引入:

components: {
  TreeNode: () => import('./TreeNode.vue')
}
上一篇 下一篇

猜你喜欢

热点阅读