场景还原
在ElementUI与Vue联合使用的时候,突然显示无法注册组件
异常代码
Uncaught TypeError: h.a is undefined
[Vue warn]: Unknown custom element: <el-container> -
did you register the component correctly?
For recursive components, make sure to provide the "name" option.
(found in <Root>)
根本原因
ElementUI是一套基于VUE的桌面端组件库,ElementUI提供了丰富的组件帮助开发人员快速构建功能强大、风格统一的页面。
解决方案
必须先引入vue 然后再引入element 否则报错 无法展示
<!-- 引入顺序 -->
<script src="js/vue.js"></script>
<script src="js/element.js"></script>