当前位置:网站首页>uniapp 修改数组属性,视图不更新
uniapp 修改数组属性,视图不更新
2022-06-22 20:56:00 【尐、孽障】
原理:之所以视图不更新,是因为数组中没有定义对应的属性,解决方法就是给数组定义属性,uniapp与vue一样,不支持在实例创建之后为对象动态增加属性,如果想动态增加对象属性,那么用常规方式是不可以的,只能通过特殊方式,比如this.$set
一:this.$forceUpdate(); 强制更新(金手指,无敌外挂,刷新整个页面)
that.msg.MediaList[that.audioId].currentTime = '00:00';
that.$forceUpdate();
二:this.$set()
_this.$set(_this.msg.MediaList[index], 'currentTime', '00:00');
边栏推荐
猜你喜欢

Introduction to database access tools

2021-04-05

2021-08-22

2021-04-16

2021-08-26

C sqlsugar, hisql, FreeSQL ORM framework all-round performance test vs. sqlserver performance test

SOA Service Oriented Architecture

Some shaders in AB package do not trigger the callback of ipreprocessshaders

three.js模拟驾驶游览艺术展厅---打造超级相机控制器

数据库访问工具简介
随机推荐
Lua -- iterator, module, meta table
Half optimized SQL
Case 2 of SQL performance degradation caused by modifying implicit parameters
Talk about SQL profile again: can I fix the execution plan?
AutoCAD - five annotation shortcuts
Spark SQL Generic Load/Save Functions(2.4.3)
剑指 Offer 11. 旋转数组的最小数字
[redisson] source code analysis of multilock
Spark SQL Start(2.4.3)
Introduction and example application of PostgreSQL string separator function (regexp\u split\u to\u table)
Solution to cache inconsistency
Dip1000,1 of D
One case of SQL performance degradation caused by modifying implicit parameters
【STM32技巧】使用STM32 HAL库的硬件I2C驱动RX8025T实时时钟芯片
2021-08-21
SQL performance optimization method for interval retrieval
The first warm-up -- implicit type conversion or other?
Learning the interpretable representation of quantum entanglement, the depth generation model can be directly applied to other physical systems
Valid parentheses
Spark RDD Programming Guide(2.4.3)