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>

  

vue error:The template root requires exactly one element.的更多相关文章

  1. The template root requires exactly one element

    The template root requires exactly one element

  2. 在Vue+element 开发中报: The template root requires exactly one elemen 错的解决和原因

    一.我正准备使用Vue + Element进行新的项目开发,然后在进行添加下一个组件时报错  二.解决及原因: 原来template中只允许模板里存在一个根节点,在 template 中添加一个 &l ...

  3. Vue入门之旅:一报错 Unknown ... make sure to provide the "name" option及error compiling template

    报错一: Unknown custom element: <custom-select> - did you register the component correctly? For r ...

  4. 聊聊Vue.js的template编译

    写在前面 因为对Vue.js很感兴趣,而且平时工作的技术栈也是Vue.js,这几个月花了些时间研究学习了一下Vue.js源码,并做了总结与输出. 文章的原地址:https://github.com/a ...

  5. org.thymeleaf.exceptions.TemplateInputException: Error resolving template "/ template might not exist or might not be accessible by any of the configured

    异常现象:在本地打包部署完全没有问题,资源文件也都可以映射上,但是打包成jar包部署到服务器上时,就一直报异常,异常信息如下: 严重: Servlet.service() for servlet [d ...

  6. [Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.

    转载自:https://segmentfault.com/a/1190000006435886 解决办法:添加package.config.js配置文件中,添加本文章的红色部分代码 import vu ...

  7. Vue学习笔记 template methods,filters,ChromeDriver,安装sass

    ChromeDriver installation failed Error with http(s) request: Error: connect ETIMEDOUT 172.217.160.80 ...

  8. 在执行gem install redis时 : ERROR: Error installing redis: redis requires Ruby version >= 2.2.2

    在执行gem install redis时 提示: gem install redis ERROR: Error installing redis: redis requires Ruby versi ...

  9. Error: Bootstrap's JavaScript requires jQuery错误

    引入bootstrap时会出现的问题:boostrap下拉菜单无效,浏览器报Uncaught Error: Bootstrap's JavaScript requires jQuery错误, 解决办法 ...

随机推荐

  1. Moving or disabling the package cache for Visual Studio 2017

    Moving or disabling the package cache for Visual Studio 2017 | Setup & Install by Heath Stewart ...

  2. ASP.NET Core使用EntityFrameworkCore CodeFrist

    1,安装环境: 如果是VS2015,确保已经升级至 update3或以上 .net core sdk (https://www.microsoft.com/net/download/core) vs2 ...

  3. 从BIRT报表文件中获取页面设置信息(页边距、纸张大小、输出方向)的方法

     从BIRT报表文件中获取页面设置信息(页边距.纸张大小.输出方向)的方法    报表打印时,尤其是套打的报表,页面设置信息非常重要,比如页边距,纸张大小,输出方向等,而且每个报表的相关参数有可能不同 ...

  4. jquery学习总结24-36

    一.jquery的自定义事件 1.自定义事件不能通过eventName()来添加,只能通过on来绑定 2.自定义事件需要通过trigger(自动触发)来进行触发 二.jauery事件命名空间 1.事件 ...

  5. Linux环境(Centos7)下部署.NetCore2.0的Web应用

    Web应用基于Windows环境下开发,然后部署到Linux 1.进入VS2017,点击新建->项目->.NetCore->ASP.NET Core Web应用程序,确定 2.选择W ...

  6. golang使用 gzip压缩

    golang使用 gzip压缩 这个例子中使用gzip压缩格式,标准库还支持zlib, bz2, flate, lzw 压缩处理_三步: 1.创建压缩文件2.gzip write包装3.写入数据 ou ...

  7. Excel把数据存入共享字符串文件中并返回该字符串的下标

    public static int InsertSharedStringItem(string text, pkg.SharedStringTablePart shareStringPart) { i ...

  8. vue组件通信新姿势

    在vue项目实际开发中我们经常会使用props和emit来进行子父组件的传值通信,父组件向子组件传递数据是通过prop传递的, 子组件传递数据给父组件是通过$emit触发事件来做到的.例如: Vue. ...

  9. [转] 分代垃圾回收的 新旧代引用问题(原标题:Back To Basics: Generational Garbage Collection)

    原文链接: https://blogs.msdn.microsoft.com/abhinaba/2009/03/02/back-to-basics-generational-garbage-colle ...

  10. Python学习笔记-函数基础

    函数基础 定义: 函数是指将一组语句的集合通过一个名字(函数名)封装起来,要想执行这个函数,只需调用其函数名即可 为什么使用函数:减少重复代码.使程序变的可扩展使程序变得易维护 1.定义一个函数 #定 ...