splice删除数组的时候出现BUG,逻辑层和视图层不同步。

小程序 文章 2022-04-01 17:20 605 0 全屏看文

AI助手支持GPT4.0

splice删除数组的时候出现BUG,逻辑层和视图层不同步。There is a bug when splice deletes the array, and the logic layer and the view layer are out of sync.

splice删除数组的时候出现BUG,逻辑层和视图层不同步。
框架类型 问题类型 终端类型 微信版本 基础库版本
小程序 Bug 微信安卓客户端 8.0.20 2.23.3

删除数组后逻辑层已经执行完毕,但是视图层没有渲染。

delArr(options){  var index = options.currentTarget.dataset.index;  var step = this.data.step;  step.splice(index,1);  this.setData({step:step});}


Framework type problem type terminal type wechat version basic library version applet bug wechat Android client 8.0.20 2.23.3 after deleting the array, the logical layer has been executed, but the view layer has not been rendered. delArr(options){ var index = options.currentTarget.dataset.index;  var step = this.data.step;  step.splice(index,1);  this.setData({step:step});}

回答:

武曲心:

var step = JSON.parse(JSON.stringify(this.data.step))

呵呵:

打印一下index,发个代码片段吧

Mr.Zhao:

工具和安卓都试了,没问题

-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
【wx:for嵌套循环】第二层循环渲染出的数据为空值(NAN)?
为什么注册服务号无法选择“法定代表人验证”方式?随便输错内容却可以出3种验证方式?
微信小程序是否可以跳转公众号分享的链接?
设备与键盘无法连接?
后台自动回复换行转义无效怎么解决?
随便看看
小程序测试号解绑之后,扫一扫小程序登录又回来了 2033
微信公众号openid? 2275
微信开放平台跟公众平台有什么区别? 3517
怎么添加小程序支付功能? 4312
教育科技公司申请微信支付被拒绝? 4695
微信公众号免300认证教程 5776
小程序已经上线,作为管理员无法在小程序数据助手查看数据? 5187
小程序广告组件通过审核,但是小程序内没有显示广告? 4961
企业微信通讯录账号被管理员误/恶意删除,怎么办? 9389
问题? 8910