为什么在promise或则callback里通过setdata无法刷新swiper-item的内容?

微信问答 文章 2021-12-03 10:20 399 0 全屏看文

AI助手支持GPT4.0

为什么在promise或则callback里通过setdata无法刷新swiper-item的内容?Why can't I refresh the content of swiper-item through setdata in promise or callback?

为什么在promise或则callback里通过setdata无法刷新swiper-item的内容?

最近遇到很奇怪的一个现象,在promise或callback里是无法通过setdata有效刷新swiper-item 的显示内容的。比如我需要在服务器通过异步获取一些url,然后通过setdata更新到与swiper-item相关的array中,然后你会发现,在promis或callback里无论通过怎样形式的setdata都是没效果的,在此外却可以正常刷新,请问这是问什么?是异步闭包的问题?不应该啊~其他组件的更新都一切正常,唯独swiper-item不行!谁能教教我?急急急急急急!!!感谢!

Recently, I encountered a strange phenomenon. In promise or callback, it is impossible to effectively refresh the display content of swiper item through SetData. For example, I need to get some URLs asynchronously on the server, and then update them to the array related to swiper item through SetData. Then you will find that no matter what form of SetData is used in promise or callback, it can be refreshed normally. What is this? Is it an asynchronous closure problem? No, the updates of other components are normal, except for the wiper item! Who can teach me? Urgent, urgent, urgent!!! thank!

鍥炵瓟锛�

八九:

排查下作用域

任性༄:

this的作用域问题?

武曲心:

没遇到过这问题,贴出你的代码和数据结构看看

-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
云开发如何突破数据库获取条数限制?
请问微信公众号配置的业务域名,重新备案会对业务有影响吗?
小程序订阅消息是不是没同意订阅发不了消息?
域名已备案,但显示未备案
视频号直播怎么推流?
随便看看
涉嫌交易异常,关闭支付权限,处罚除退款外出资金权限,怎么解决? 1101
selectcomponent 返回null 891
关于painter 画出海报保存不了,不报错也没进入回调,有大佬么? 1035
推送成功后为什么用户收到到推文? 808
创建直播间不是报200002就是300031? 810
调用sitesearch接口出现47001 data format error的错误? 681
微信广告服务商怎么解绑? 953
真机调试时,一直卡在一进度? 777
服务号子菜单跳转h5携带自定义参数? 793
这也内容不符合规则? 705