uniapp定时刷新
时间: 2023-08-19 07:06:45 浏览: 228
在uniapp中,如果条件不允许使用websocket或者暂时为演示项目,可以使用定时刷新来保持页面数据的更新。下面是一个示范的步骤:
1. 首先,定义两个变量autoRefreshId和theTime。其中,autoRefreshId用于判断是否进行自动刷新,1表示刷新,0表示停止;theTime用于记录刷新的时间。
引用 [3<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [前端项目(uniapp、vue)中如何做页面数据定时刷新](https://blog.csdn.net/qq_42761482/article/details/122365099)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [uniapp 前端定时刷新token,接口排队等待,promise 接口封装](https://blog.csdn.net/u011169725/article/details/130599331)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文