8***@qq.com
8***@qq.com
  • 发布:2019-07-03 23:30
  • 更新:2020-01-09 10:29
  • 阅读:3210

报Module Error错误

分类:HBuilderX

刚下载新版hbuiderx使用,index.vue 页面添加 swiper组件,保存后运行就报错

Module Error (from ./node_modules/vue-loader/lib/loaders/templateLoader.js):
23:17:54.456 (Emitted value instead of an instance of Error)
23:17:54.460 Errors compiling template:
23:17:54.460 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.
23:17:54.460 6 | </view>
23:17:54.467 7 | </view>
23:17:54.467 8 |
23:17:54.470 |
23:17:54.470 9 | <swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000">
23:17:54.470 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23:17:54.470 10 | <swiper-item>
23:17:54.470 | ^^^^^^^^^^^^^^
23:17:54.477 11 | <view class="swiper-item"></view>
23:17:54.477 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23:17:54.480 12 | </swiper-item>
23:17:54.480 | ^^^^^^^^^^^^^^^
23:17:54.480 13 | <swiper-item>
23:17:54.480 | ^^^^^^^^^^^^^^
23:17:54.480 14 | <view class="swiper-item"></view>
23:17:54.486 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23:17:54.490 15 | </swiper-item>
23:17:54.490 | ^^^^^^^^^^^^^^^
23:17:54.490 16 | <swiper-item>
23:17:54.490 | ^^^^^^^^^^^^^^
23:17:54.496 17 | <view class="swiper-item"></view>
23:17:54.496 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23:17:54.500 18 | </swiper-item>
23:17:54.500 | ^^^^^^^^^^^^^^^
23:17:54.500 19 | </swiper>
23:17:54.500 | ^^^^^^^^^

2019-07-03 23:30 负责人:无 分享
已邀请:
8***@qq.com

8***@qq.com (作者) - upi-app开发着

HbuilderX 下载的是正式版v2.0.1 App开发版

低价位小菜

低价位小菜

最后是什么问题,我小程序运行也是一样的问题呢,明明h5和app就没问题

t***@foxmail.com

t***@foxmail.com

看报错信息应该是<template>标签下必须只有一个根标签,如果有多个就报错,即

<template>  
<view>  
...  
</view>  
</template>

我之前遇到过

该问题目前已经被锁定, 无法添加新回复