当前位置:网站首页>The method of changing a value in the array and a value in the object of wechat applet
The method of changing a value in the array and a value in the object of wechat applet
2022-04-23 17:44:00 【Youyoujing】
1、 Change the value in the array
paraList: [
{
txt:'123',chose:false},
{
txt:'1234',chose:false}
]
let choseChange = "paraList[" + index + "].chose"
this.setData({
[choseChange]: true
})
Be careful : The string of the selected array does not need to be written this.data. !!!
You can change the value of a specific subscript in the array
2、 Change the value in the object
navbarData: {
isfixed: false,
iswhite: false, //icon color
showCapsule: 1, // Whether to display the icon in the upper left corner 1 Presentation display 0 Means not to show
title: ' Customer list ', // The navigation bar Middle title
backgroundcolor: '#fff',
isintercept: false, // Back to intercept
},
let title = 'navbarData.title'
this.setData({
[title]: ' Team member customer ',
})
版权声明
本文为[Youyoujing]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230550532201.html
边栏推荐
- Gets the time range of the current week
- Leak detection and vacancy filling (VII)
- Change Oracle to MySQL
- QT modification UI does not take effect
- uni-app黑马优购项目学习记录(下)
- 双指针进阶--leetcode题目--盛最多水的容器
- 958. Complete binary tree test
- 剑指 Offer 22. 链表中倒数第k个节点-快慢指针
- ECMAScript history
- Where is the configuration file of tidb server?
猜你喜欢
Future usage details
If you start from zero according to the frame
Learning record of uni app dark horse yougou project (Part 2)
Chrome浏览器的跨域设置----包含新老版本两种设置
Future 用法详解
超分之TDAN
Using quartz under. Net core -- general properties and priority of triggers for [5] jobs and triggers
Exercise: even sum, threshold segmentation and difference (two basic questions of list object)
Kubernetes service discovery monitoring endpoints
92. Reverse linked list II byte skipping high frequency question
随机推荐
On the method of outputting the complete name of typeID from GCC
41. The first missing positive number
Add drag and drop function to El dialog
JVM class loading mechanism
440. The k-th small number of dictionary order (difficult) - dictionary tree - number node - byte skipping high-frequency question
Generating access keys using JSON webtoken
Change Oracle to MySQL
Land cover / use data product download
JS interview question: FN call. call. call. Call (FN2) parsing
Dry goods | how to extract thumbnails quickly?
SiteServer CMS5. 0 Usage Summary
关于gcc输出typeid完整名的方法
Websocket (basic)
Header built-in object
常用SQL语句总结
Manually implement simple promise and its basic functions
1217_ Generating target files using scons
Excel quickly and automatically fills the contents of a row on a blank cell
索引:手把手教你索引从零基础到精通使用
How to use the input table one-way service to send (occupy less) picture files (body transmission)? FileReader built-in object involved