当前位置:网站首页>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
边栏推荐
- [the background color changes after clicking a line]
- The source of anxiety of graduating college students looking for technology development jobs
- CPT 104_ TTL 09
- (11) Vscode code formatting configuration
- To understand Devops, you must read these ten books!
- Study notes: unity customsrp-10-point and spot shadows
- Cross domain CORS relationship~
- selenium预先加载cookie的必要性
- FileReader API file operation
- 狼叔来找翻译人员了--plato--持续翻译中.....
猜你喜欢

JSP -- Introduction to JSP

!!!!!!!!!!!!!!!!!!

Use of uniapp native plug-ins

SQL Server检索SQL和用户信息的需求

When is it appropriate for automated testing? (bottom)

PIP free export with path (@ file: / / /) notes

To understand Devops, you must read these ten books!

MFC实现资源单独Dll实现

Branch and loop statements

Low code and no code considerations
随机推荐
The introduction of lean management needs to achieve these nine points in advance
Excel 2016 打开文件第一次打不开,有时空白,有时很慢要打开第二次才行
Use of uniapp native plug-ins
!!!!!!!!!!!!!!!!!!
2021-10-08
Basic knowledge of redis
npm升级后问题,慌得一批
2021-09-28
狼叔来找翻译人员了--plato--持续翻译中.....
How to realize adaptive layout
Requirements for SQL server to retrieve SQL and user information
Study notes: unity customsrp-11-post processing --- bloom
Study notes: unity customsrp-12-hdr
How to add beautiful code blocks in word | a very complete method to sort out and compare
When is it appropriate for automated testing? (bottom)
Study notes: unity customsrp-10-point and spot shadows
Tslint annotations ignore errors and restful understanding
Multi process model in egg -- egg document Porter
The source of anxiety of graduating college students looking for technology development jobs
Collaboration future object and concurrent futures