初学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或别的元素包裹全部的元素
Logo

前往低代码交流专区

更多推荐