Vue报错——Unknown custom element: XXX- did you register the component correctly?
element
A Vue.js 2.0 UI Toolkit for Web
项目地址:https://gitcode.com/gh_mirrors/eleme/element

·
今天在项目中遇到一个报错:Unknown custom element: <v-line>- did you register the component correctly? For recursive components, make sure to provide the “name” option.
一般这种问题一定是组件引入时的报错,如果使用vue cli脚手架可以参考如下常见解决方法:
1. 导入第三方库的配置文件时,一定要Vue use一下(比如:Echarts)
// 导入echarts 配置文件
import Echarts from '@/components/echarts' // echarts文件夹下有index.js配置文件(包含echarts包的引入)
Vue.use(Echarts) // 注意一下这句话是否添加!!!
2. 查看一下组件定义的名字和实际在模板中使用的名字是否一致
3. 查看一下组件引用路径是否正确,注意@代表/src,另外./表示当前目录下,…/表示上一级目录
这是可能出现的几种情况,如果后续遇到上述未出现的情况将继续添加。




A Vue.js 2.0 UI Toolkit for Web
最近提交(Master分支:8 个月前 )
c345bb45
1 年前
a07f3a59
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update table.md
* Update transition.md
* Update popover.md 1 年前
更多推荐
所有评论(0)