Vue组件循环依赖、递归
1、组件循环依赖:
A组件中有B组件,B组件中有A组件
系统报错:
Unknown custom element: <A> - did you register the component correctly? For recursive components, make sure to provide the "name" option
解决方法:
//B中调用A,使用异步加载
const A = () => import('@/components/.../A.vue');
2、组件递归:
添加name option,无需引入注册,直接在内部使用<Self />