当前位置:网站首页>Do not update the sub component page of parameter object passed from parent to child of nailing applet?
Do not update the sub component page of parameter object passed from parent to child of nailing applet?
2022-06-13 08:08:00 【Dark_ programmer】
When developing nailing applet , When I come across such a problem .
The... Passed from the parent to the child Values are arrays , Parent component passed setData to update Value time subcomponent No changes in data were detected
The previous usage is as follows :
The parent component uses the child component :
<Child list='{
{arrayList}}'/>
The parent component updates the data :
data:{
arrayList:[]
}
...
const newList = [1, 2, 3, 4, 5, 6]
this.setData({
arrayList: newList
})
The child component receives the parent component data and stores it in itself data In order to use
The subcomponent receives parameters :
data:{
list: []
}
...
this.setData({
list: this.props.list
})
Use of subcomponents :
<view a:for="{
{list}}">
{
{item}}
</view>
After trying , It is modified to use the parent component directly props The data in
Modify the usage as follows :
The subcomponent receives parameters :
props: {
list: ()=>Object;
}
Use of subcomponents :
<view a:for="{
{list}}">
{
{item}}
</view>
边栏推荐
- CCNP_ BT-MGRE
- 25 | 冒险和预测(四):今天下雨了,明天还会下雨么?
- 1. fabric2.2 comprehensive learning - Preface
- uniapp 小程序根据权限动态生成 tabbar
- 26 | Superscalar和VLIW:如何让CPU的吞吐率超过1
- Go interface implementation principle [advanced level]: type_ interface struct
- Rust writes near smart contract
- How to install the bdtab (BD) new tab plug-in in edge browser (Graphic tutorial)
- Common shell script development specifications
- [MySQL] rapid data deletion recovery tool - binlog2sql
猜你喜欢

OpenHarmony笔记-----------(一)

Selenium reports an error deprecationwarning: executable_ path has been deprecated, please pass in a Service object

赋予代码生命力--读代码整洁之道

ERP 基础数据 概念

直播回顾 | 积极防御体系下BAS技术创新探索

Clickhouse column basic data type description

【clickhouse专栏】基础数据类型说明

Structural analysis of hyperledger fabric (I)

适合生鲜批发行业的几种精准接单方式

2022起重机械指挥考试题模拟考试题库及在线模拟考试
随机推荐
[MySQL] methods for troubleshooting lock related problems
Dfinity (ICP) identity authentication and ledger quick start-3
力扣(LeetCode)163. 缺失的区间(2022.06.12)
2022起重机械指挥考试题模拟考试题库及在线模拟考试
5. fabric2.2 installation and submission contract (using official demo)
How to dynamically delete data rows in a table through JS (keep the head)
MySQL table partitioning
Dfinity (ICP) basic development tutorial-5
Disk C is full? A few simple tips teach you to release and clean up tens of gigabytes of space on the C disk, the most effective way to clean up the C disk
母婴用品批发行业使用管理软件提高效率 实现降本增效
CCNP_ Bt-ospf big experiment (1)
Install cuda+cusp environment and create the first helloword starter project
Win10系统如何修改桌面路径
Effective Go - The Go Programming Language
17. how to understand multi version concurrency control and read / write sets of fabric smart contracts? (vernacular version)
Create a substrate private network
ES6 deleting an attribute of an object
21 | 面向流水线的指令设计(下):奔腾4是怎么失败的?
杨氏矩阵查找数字是否存在
Detailed explanation of digital certificate and Ca