Vue js错误:组件模板应该只包含一个根元素 [英] Vue js error: Component template should contain exactly one root element

查看:925
本文介绍了Vue js错误:组件模板应该只包含一个根元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道错误是什么,到目前为止,我正在测试控制台日志,以便在选择文件(上传)后检查更改。

I don't know what the error is, so far I am testing through console log to check for changes after selecting a file (for uploading).

我运行 $ npm run watch ,我收到以下错误:

When I run $ npm run watch, i get the following error:


Webpack正在观看文件......

"Webpack is watching the files…

95%发光

错误编译失败1次错误

19:42:29

ERROR Failed to compile with 1 errors
19:42:29

错误在./resources/assets/js/components/File.vue

error in ./resources/assets/js/components/File.vue

(发出的值而不是Error的实例)Vue模板语法
错误:

(Emitted value instead of an instance of Error) Vue template syntax error:

组件模板应该只包含一个根元素。如果你是
在多个元素上使用v-if,使用v-else-if代替它们

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.

@ ./resources/assets/js/components /AvatarUpload.vue 5:2-181 @
./resources/assets/js/app.js @ multi ./resources/assets/js/app.js
./resou rces / assets / sass / app.scss

@ ./resources/assets/js/components/AvatarUpload.vue 5:2-181 @ ./resources/assets/js/app.js @ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss"

我的File.vue是

My File.vue is

这篇关于Vue js错误:组件模板应该只包含一个根元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆