在.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来代替它们。】

报错文件如下:

修改为:

成功显示:

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.的更多相关文章

  1. 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

    背景: 在使用VUE添加标签的时候编译报错,报错如下: Component template should contain exactly one root element. If you are u ...

  2. 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 解决办法

    Failed to compile. ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-5992 ...

  3. 组件嵌套时报: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.

    在组件嵌套的过程中,报了一个错误: 这里报错的原因是:vue的组件(模板)只能有一个根节点,即.vue文件中的<template>标签下只能有一个子元素. 因此,建议大家在写.vue组件的 ...

  4. 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.

    运行代码时,一直报错: 经过查询后才知道,vue模板只能有一个跟对象 我是这样写的 最后修改为 就可以正常运行了

  5. vue父子组件嵌套的时候遇到 - Component template should contain exactly one root element. If you are using v-i

    转自:https://blog.csdn.net/yangyiboshigou/article/details/72084619

  6. 【错误总结】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.

    大致意思是因为模板里面应该包含一个根元素,使用组件的时候应该用div或p标签包起来

  7. vue 报错 :属性undefined(页面成功渲染)

    vue 报错:Cannot read property 'instrumentId' of undefined" 相关代码如下: <template> ... <span& ...

  8. Vue报错——“Trailing spaces not allowed”

    在VSCode中开发Vue 报错:“Trailing spaces not allowed” 这是空格多了,删除多余的空格就可以了

  9. Vue 报错Error in render: “TypeError: Cannot read properties of null (reading ‘xxx’)” found in

    前端vue报错 [Vue warn]: Error in render: "TypeError: Cannot read properties of null (reading 'name' ...

随机推荐

  1. bzoj 3721: PA2014 Final Bazarek 贪心

    如果没有限制,直接取前 $k$ 大即可. 有限制,则只有几种可能:奇换偶,偶换奇. 维护奇数偶数的前缀最小值和后缀最大值即可. code: #include <bits/stdc++.h> ...

  2. @ResponseBody 中文乱码 问题

    这篇博文针对的是以下的情形: 当@ResponseBody 的对象是个蕴含中文的实体对象时,一切正常,当@ResponseBody 的对象是个中文String时,接收到乱码. (如果连前半句话的情况都 ...

  3. codeforces524E

    题意:n*m的矩阵,给出k个点,Q次询问,问每个矩阵中每个点是否被看管,一个点被看管的定义是那个点所在的行或列有点,n,m<=1e5,k,q<=2e5 sol :发现行和列是独立的,即要么 ...

  4. Python基础之定义有默认参数的函数

    1. 构建有默认参数的函数 当我们在构建一个函数或者方法时,如果想使函数中的一个或者多个参数使可选的,并且有一个默认值,那么可以在函数定义中给参数指定一个默认值,并且放到参数列表的最后就行了.比如: ...

  5. ros topic 命令

    #查看topic频率rostopic hz /xxx_imu_driver/imu #查看topic信息rostopic info /xxx_imu_driver/imu #查看topic数据rost ...

  6. Ubuntu 14.04 改变文件或者文件夹的拥有者

    只有系统管理者(root)才有这样的权限#将文件 file1.txt 的拥有者设为 runoob,群体的使用者 runoobgroupchown runoob:runoobgroup file1.tx ...

  7. [luogu P1527]矩阵乘法(矩形k小)

    传送门 Description 给你一个N*N的矩阵,不用算矩阵乘法,但是每次询问一个子矩形的第K小数. Solution 整体二分 练习一波... 就是一堆询问放在一起二分 另外的,第一次发现原来矩 ...

  8. CF2B The least round way(贪心+动规)

    题目 CF2B The least round way 做法 后面\(0\)的个数,\(2\)和\(5\)是\(10\)分解质因数 则把方格中的每个数分解成\(2\)和\(5\),对\(2\)和\(5 ...

  9. gradle的简单使用

    Gradle是一个基于JVM的构建工具,是一款通用灵活的构建工具,支持maven, Ivy仓库,支持传递性依赖管理,而不需要远程仓库或者是pom.xml和ivy.xml配置文件,基于Groovy,bu ...

  10. 如何设置xshell代理?

    场景:我想在公司内部用一台服务器A访问客户内网的机器C.在公司和客户之间有一台中间服务器B,我只能先连接到中间服务器,然后通过中间服务器跳转才能到客户C机器. 上面场景的连接策略:A->B-&g ...