使用el-dialog时,报错“Unknown custom element:<el-dialog> did you register the component correctly?...make sure to provide the 'name' option”

前端之家收集整理的这篇文章主要介绍了使用el-dialog时,报错“Unknown custom element:<el-dialog> did you register the component correctly?...make sure to provide the 'name' option”前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
初学vue时,曾遇到一个无语的问题,在用el-dialog时一直显示没有导入,结果发现是因为没有把element ui引入到项目里。

需进行以下步骤:
1.执行:
npm install element-ui -s
 
2.在main.js文件里加入以下代码
 
import ElementUI from 'element-ui' import 'element-ui/lib/theme-default/index.css' Vue.use(ElementUI)
 
3.完成以上步骤,即可正常用element ui的东西了。

猜你在找的Web前端相关文章