【问题描述】
[Vue warn]: Failed to resolve component: sidebar-item If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
译文:
[Vue warn]:如果这是一个本地定制元素,请确保通过compilerOptions.isCustomElement将其排除在组件解析之外。
在使用Vue3 setup 语法糖做侧边栏渲染的时候,用到了组件递归,但是始终无法渲染出内容。
【解决方法】
阅读了一下 Vue的官方文档, 因为使用了 setup
语法糖所以需要递归使用组件,需要在在当前组件中导入组件并设置别名。
至此,问题得以解决。
欢迎大佬讨论与斧正……