当前位置:网站首页>Three methods of list rendering
Three methods of list rendering
2022-04-23 05:26:00 【Courtesy.】
According to the element And the index name of the element You can render the list
for="{
{list}}":list For the source data array , The default array element name is $item
for="{
{value in list}}":value For the custom array element name , The default array element index name is $idx
for="{
{(index, value) in list}}":index Index names for custom array elements ,value For the custom array element name
<import name="tabbarpage" src="../Tabbar/index.ux"></import>
<template>
<div class="tutorial-page">
<!-- The way 1: Default $item Represents the elements in an array , $idx Represents the index in the array -->
<div class="tutorial-row" for="{
{list}}" tid="uniqueId">
<text>{
{
$idx}}.{
{
$item.name}}</text>
</div>
<!-- The way 2: Custom element variable name -->
<div class="tutorial-row" for="value in list" tid="uniqueId">
<text>{
{
$idx}}.{
{
value.name}}</text>
</div>
<!-- The way 3: Custom elements 、 Variable name of the index -->
<div class="tutorial-row" for="(personIndex, personItem) in list" tid="uniqueId">
<text>{
{
personIndex}}.{
{
personItem.name}}</text>
</div>
<tabbarpage></tabbarpage>
</div>
</template>
<script>
export default {
private: {
list: [
{
name: 'aa2', uniqueId: 1},
{
name: 'bb', uniqueId: 2},
{
name: 'cc', uniqueId: 3}
]
},
}
</script>
<style lang="less">
.tutorial-page {
flex-direction: column;
background-color: #ccc;
}
</style>
版权声明
本文为[Courtesy.]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220544338936.html
边栏推荐
- Uniapp hot update with progress bar
- 2021-10-12
- Getting started with varnish
- selenium預先加載cookie的必要性
- Laravel routing settings
- Graphics.FromImage报错“Graphics object cannot be created from an image that has an indexed pixel ...”
- Box collapse and margin collapse
- Collaboration future object and concurrent futures
- [the background color changes after clicking a line]
- Ehcache Memcache redis three caches
猜你喜欢
The title bar will be pushed to coincide with the status bar
青岛敏捷之旅,来了!
Blender程序化地形制作
Anti crawler (0): are you still climbing naked with selenium? You're being watched! Crack webdriver anti crawler
Good test data management, in the end how to do?
2021-09-23
mariadb数据库的主从复制
MFC implementation resources are implemented separately by DLL
Three 之 three.js (webgl)旋转属性函数的简单整理,以及基于此实现绕轴旋转的简单案例
Use of uniapp native plug-ins
随机推荐
varnish入门
mariadb数据库的主从复制
Let the LAN group use the remote device
【openh264】cmake: msopenh264-static
Three 之 three.js (webgl)简单实现根据点绘制线/弧线(基于LineGeometry / Line2 / LineMaterial,绘制两点基于圆心的弧线段)
Wbpack configuring production development environment
Box collapse and margin collapse
青岛敏捷之旅,来了!
App Store年交易额100万美元只缴15%佣金,中小开发者心里很矛盾
Five key technologies to improve the devsecops framework
Three 之 three.js (webgl)旋转属性函数的简单整理,以及基于此实现绕轴旋转的简单案例
TSlint注释忽略错误和RESTful理解
selenium預先加載cookie的必要性
Three of three JS (webgl) is simple to draw lines / arcs according to points (based on linegeometry / line2 / linematerial, draw two arc segments based on the center of the circle)
CORS and proxy (づ  ̄ 3  ̄) in egg ~ the process of stepping on the pit and filling the pit ~ tot~
Asynchronous iterator & asynchronous generator & asynchronous context manager
使用 Kears 实现ResNet-34 CNN
C test calls the paddlesharp module to recognize pictures and words
Publish your own wheel - pypi packaging upload practice
PIP free export with path (@ file: / / /) notes