vue error:The template root requires exactly one element.
error:[vue/valid-template-root]
The template root requires exactly one element.
原因:
因为vue的模版中只有能一个根节点,所以在<template>中插入第二个元素就会报错
解决方案:
将<template>中的元素先用一个<div>包起来。
<template><div><p>123</p><p>456</p></div>
</template>
本文转载于:猿2048https://www.mk2048.com/blog/blog.php?id=hjchaa&title=vue error:The template root requires exactly one element.
vue error:The template root requires exactly one element.相关推荐
- 【Vue.js 3.0】不使用根标签,Error:[vue/no-multiple-template-root] The template root requires exactly one ...
[vue/no-multiple-template-root]The template root requires exactly one element.eslint-plugin-vue 原因分析 ...
- The template root requires exactly one element(总算是解决)
为了在vscode中编写的代码看起来规范,肯定要使用全局的ESLint配置 一.在VS Code中添加ESLint插件 二.在node全局路径中生成 eslint 的配置文件 .eslintrc.js ...
- The template root requires exactly one element.
template中只允许模板里存在一个根节点,在 template 中添加一个 标签,之后所有的组件全部加在 . <template><div class = "" ...
- Vue3 VSCode新建项目报错The template root requires exactly one element.
1.首先我们点击左侧第四个图标插件 2.输入框搜索vetur插件 3.点击设置图标,再点击扩展设置 4.搜素vetur>validation>template,取消vetur>val ...
- vue报错:the template root disallows ‘v-for‘ directives解决办法
原代码: <template><div v-for="(item, index) in apps" :key="index"> {{ i ...
- 页面报错[Vue warn]: Error compiling template
页面上报错:[Vue warn]: Error compiling template 最终检查是因为: 出现的原因是把新建的实例放在了被绑定的组件当中 div 中有script <div id= ...
- vue Syntax Error Error PostCSS plugin postcss-pxtorem requires PostCSS 8
vue Syntax Error: Error: PostCSS plugin postcss-pxtorem requires PostCSS 8. Migration guide for end- ...
- SpringBoot(二)Error resolving template “xxx”, template might not exist or might not be accessible解决办法
SpringBoot 7 SpringBoot整合持久层技术 7.1 整合JDBC 7.1.1 修改pom文件 <?xml version="1.0" encoding=&q ...
- Error:This Gradle plugin requires Studio 3.0 minimum
导入一个demo提示Error:This Gradle plugin requires Studio 3.0 minimum 在gradle.properties中导入 android.injecte ...
最新文章
- rpc框架都有哪些_这六种微服务RPC框架,你知道几个?
- ok6410 3.0.1内核调用V4L接口出错解决方法(转)
- 电子科大电气工程导师介绍绍_电子科技大学计算机科学与工程学院研究生导师介绍:葛树志...
- python idle退出_【ZZ】windows+python2.7在IDLE中执行sys.exit()出现的问题及解决方案
- 17行html代码实现的将网页文本保存成本地文本文件
- python基础知识-8-三元和一行代码(推导式)
- 嵌入式WiFi芯片价格战已经打响 MCU企业该醒悟了
- 日志转化成json格式
- android的动态注册,Android JNI 函数注册的两种方式(静态注册/动态注册)
- Leetcode每日一题:514.freedom-trail(自由之路)
- 第一篇:centos7下svn的安装与卸载
- rsync定时同步备份
- 一份神奇的礼物(1)
- 简单的开源日志Log4D delphi 6---delphi xe 10全可用
- 化龙小型汽车考场手动挡C1科三考试技巧
- Python根据字幕文件自动给视频添加字幕
- 如何将pdf文件压缩变小?
- pip安装faiss
- java交通调度,java毕业设计_springboot框架的的车辆调度管理系统
- Godot着色器基础