今天在做项目的时候突然出现了Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the “name” option.这个问题,查了好久最后发现原来是自己写法错误,不小心写成了import {card} from "./components/card.vue"这样的形式,多加了一个大括号,结果导致了错误。
为了避免类似的错误,我总结了以下几点:
1引入组件的写法:import card from “./components/card.vue”,card是组件名,后面是路径
2.引入js的写法:import “./assets/js/chat.js” ,后面直接跟要引入的js文件的路径
3.引入mint-ui里的组件:一般按照官网的写法就可以

Logo

前往低代码交流专区

更多推荐