vue常见错误

来源:互联网 发布:java assert 用法 编辑:程序博客网 时间:2024/06/18 04:39
初学vue常见一些错误,常常一脸蒙逼...觉得应该记录一下。
ERROR in ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-8b4df900","hasScoped":false,"transformToRequire":{"video":"src","source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0&bustCache!./src/App.vue
(Emitted value instead of an instance of Error)
  Error compiling template:
 
  <h1>mint-ui-example</h1>
  <mt-button
   type="primary"
   @click="sheetVisible">
   选择操作
  </mt-button>
 
  - Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.

@ ./src/App.vue 6:0-351
@ ./src/main.js
@ multi ./build/dev-client ./src/main.js

总结 :
    vue模板只能有一个根对象,另外要用div或别的元素包裹全部的元素