Vue报错:[Vue warn]: Unknown custom element: <el-dialog> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
我在黑窗口中输入了 npm i element-ui -S命令之后,就开始创建Vue component,添加路由了。运行后浏览器不显示Element-UI的标签。
解决方法:
这是没有在main.js中导入element-ui,使用element -ui 导致的。
在main.js中粘贴以下代码即可
//导入组件库
import ElementUI from 'element-ui'
//导入组件相关样式
import 'element-ui/lib/theme-chalk/index.css'
//配置Vue插件 将El安装到Vue上
Vue.use(ElementUI);