Cannot use v-for on stateful component root element because it renders multiple elements.
<template name:trailerStars>
<image v-for="yellow in yellowScore"
src="../static/icos/star-yellow.png" class="star-ico">
</image>
<image v-for="gray in grayScore"
src="../static/icos/star-gray.png" class="star-ico">
</image>
</template>
错误原因:
不能在根元素(root element)使用 v-for,因为v-for是个循环体呈现多个元素,v-for在根元素上导致无法渲染。
解决方案:
将元素包裹到另外的标签中:
<template name:trailerStars>
<view>
<image v-for="yellow in yellowScore"
src="../static/icos/star-yellow.png" class="star-ico">
</image>
<image v-for="gray in grayScore"
src="../static/icos/star-gray.png" class="star-ico">
</image>
</view> </template>
参考链接:https://blog.csdn.net/hua_ban_yu/article/details/80256611
Cannot use v-for on stateful component root element because it renders multiple elements.的更多相关文章
- Ejb3 + Jboss8 出现Session id hasn't been set for stateful component
Ejb 3 + JBoss 8 在使用客户端远程访问有状态的Ejb对象时,出现ERROR: Session id hasn't been set for stateful component 出现该 ...
- 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 ...
- 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 ...
- 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文件中引入了 element-ui 的 table 和 pagination 组件后,报错:Component template should contain exactly one roo ...
- AngularJS: 'Template for directive must have exactly one root element' when using 'th' tag in directive template
.controller('HomeController', function($scope,$location) { $scope.userName='天下大势,为我所控!'; $scope.clkU ...
- Caused by: org.xml.sax.SAXParseException; systemId: file:/home/hadoop/hive-0.12.0/conf/hive-site.xml; lineNumber: 5; columnNumber: 2; The markup in the document following the root element must be well
1:Hive安装的过程(Hive启动的时候报的错误),贴一下错误,和为什么错,以及解决方法: [root@master bin]# ./hive // :: INFO Configuration.de ...
- which had no Root Element. This likely means the XML is malformed or missing
今天按照古月老师的步骤,想在RViz中配置插件. 按步骤做下来后,一运行,出现如下错误: [E[ERROR] [1523370744.057263390]: Skipping XML Document ...
- maven web项目的web.xml报错The markup in the document following the root element must be well-formed.
maven项目里面的web.xml开头约束是这样的 <?xml version="1.0" encoding="UTF-8"?> <web-a ...
- Possible overdraw: Root element paints background @drawable/happy with a theme that also paints a background (inferred theme is @style/AppTheme)
安卓界面插入背景图片,当图片内存太大时,界面在切换时会加载失败,这是什么原因呢?这是设置android:background属性时发出的warning: Possible overdraw: Root ...
- [React] Write a stateful Component with the React useState Hook and TypeScript
Here we refactor a React TypeScript class component to a function component with a useState hook and ...
随机推荐
- intellij IDEA安装JDBC报错 No suitable driver found for jdbc:mysql://localhost:3306
项目场景: 本地尝试使用intellij IDEA加载JDBC连接MySQL,尝试实现增删改查,本来想做一个小Demo. 问题描述 报错: java.lang.ClassNotFoundExcepti ...
- 玩一玩 Ubuntu 下的 VSCode 编程
一:背景 1. 讲故事 今天是五一的最后一天,想着长期都在 Windows 平台上做开发,准备今天换到 Ubuntu 系统上体验下,主要是想学习下 AT&T 风格的汇编,这里 Visual S ...
- 2022-09-29:在第 1 天,有一个人发现了一个秘密。 给你一个整数 delay ,表示每个人会在发现秘密后的 delay 天之后, 每天 给一个新的人 分享 秘密。 同时给你一个整数 forg
2022-09-29:在第 1 天,有一个人发现了一个秘密. 给你一个整数 delay ,表示每个人会在发现秘密后的 delay 天之后, 每天 给一个新的人 分享 秘密. 同时给你一个整数 forg ...
- 2020-12-21:redis中,rpop和brpop的区别?
福哥答案2020-12-21:[答案来自此链接:](http://bbs.xiangxueketang.cn/question/806)Redis Rpop 命令用于移除列表的最后一个元素,返回值为移 ...
- 2022-06-19:给出n个数字,你可以任选其中一些数字相乘,相乘之后得到的新数字x, x的价值是x的不同质因子的数量。 返回所有选择数字的方案中,得到的x的价值之和。 来自携程。
2022-06-19:给出n个数字,你可以任选其中一些数字相乘,相乘之后得到的新数字x, x的价值是x的不同质因子的数量. 返回所有选择数字的方案中,得到的x的价值之和. 来自携程. 答案2022-0 ...
- 2022-01-09:整数转换英文表示。将非负整数 num 转换为其对应的英文表示。 示例 1: 输入:num = 123, 输出:“One Hundred Twenty Three“。 力扣273。
2022-01-09:整数转换英文表示.将非负整数 num 转换为其对应的英文表示. 示例 1: 输入:num = 123, 输出:"One Hundred Twenty Three&quo ...
- 2021-07-11:给定一个棵完全二叉树,返回这棵树的节点个数,要求时间复杂度小于O(树的节点数)。
2021-07-11:给定一个棵完全二叉树,返回这棵树的节点个数,要求时间复杂度小于O(树的节点数). 福大大 答案2021-07-11: 右树最左节点层数==左树最左节点层数,左树是满二叉树,统计左 ...
- 【Linux】详解六种配置Linux环境变量的方法(以centos为例)
本文时间 2023-05-19 作者:sugerqube漆瓷 本文重理解,!!忽略环境变量加载原理!! 本文目标:理解六大环境变量配置,选择合适的配置文件进行配置 配置环境的理由 以shell编程为例 ...
- 欢迎来到farter的可能是最后一个用于博客的地方【
目前先把公告栏里放一堆链接作为导航了(手机上竟然没有公告栏??? 准备从新浪博客往这里迁,整活可能也在这里? 还是复制一份公告栏的链接库吧( 歌声合成相关文章 敝个人站(好用好玩都在这) 敝渣浪博客( ...
- Tomcat请求处理流程与源码浅析
系列文章目录和关于我 一丶Connector 在tomcat中,Connector负责开启socket并且监听客户端请求,返回响应数据. 其中: Endpoint:tomcat中没有这个接口,只有Ab ...