越努力,越幸运

朱季谦

腾讯云社区2022年度最佳作者、阿里云专家博主认证

使用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的东西了。
posted @ 2019-08-12 09:50  朱季谦  阅读(18189)  评论(0编辑  收藏  举报