Failed to compile. ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-59926570","hasScoped":true,"transformToRequire":{"video":["src","poster"],"source":"src&q…
背景: 在使用VUE添加标签的时候编译报错,报错如下: 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. 代码如下: <template> <el-form ref="form" :model="form" label-…
在.vue文件中引入了 element-ui 的 table 和 pagination 组件后,报错: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.[翻译:组件模板应该只包含一个根元素. 如果您在多个元素上使用v-if,请使用v-else-if来代替它们.] 报错文…
大致意思是因为模板里面应该包含一个根元素,使用组件的时候应该用div或p标签包起来…
在组件嵌套的过程中,报了一个错误: 这里报错的原因是:vue的组件(模板)只能有一个根节点,即.vue文件中的<template>标签下只能有一个子元素. 因此,建议大家在写.vue组件的时候,最好在<template>下添加一个标签(比如div),在这个标签里面写我们的组件. 例如: <template> <div> <!--你的组件代码--> </div> </template> 我这边就是用这种方法解决的.也希望能帮…
运行代码时,一直报错: 经过查询后才知道,vue模板只能有一个跟对象 我是这样写的 最后修改为 就可以正常运行了…
当运行vue出现错误Component template should contain exactly one root element. If you ...的时候,我们只需要将<template>标签中的代码包裹到<div>标签中即可. 报错代码 点击查看代码 <template> <h1>Hello World</h1> </template> 改为这样才不会报错 点击查看代码 <template> <div…
VUE中动态路由出错: vue.esm.js?a026: [Vue warn]: Failed to mount component: template or render function not defined. found in ---> <Anonymous> <ElCard> <ElTabPane> <ElTabs> <MainContent> at src\components\admin\MainContent.vue <…
Failed to mount component: template or render function not defined. vue-loader13.0有一个变更就是默认启用了esModule 把vue-loader降至13.0以下,就可以解决…