当前位置:网站首页>uniapp小程序检查、提示更新
uniapp小程序检查、提示更新
2022-07-31 21:33:00 【寒墨茗殇】
上代码:
xcxCheckUpdate.js
export default function xcxCheckUpdate(){
const updateManager = uni.getUpdateManager();
updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调
});
updateManager.onUpdateReady(function (res) {
uni.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success(res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate();
}
}
});
});
updateManager.onUpdateFailed(function (res) {
// 新的版本下载失败
});
}App.vue:
<script>
import xcxCheckUpdate from 'xcxCheckUpdate.js'
export default {
// 检测小程序更新
xcxCheckUpdate()
}
</script>边栏推荐
- Qualcomm cDSP simple programming example (to query Qualcomm cDSP usage, signature), RK3588 npu usage query
- Memblaze发布首款基于长存颗粒的企业级SSD,背后有何新价值?
- LevelSequence source code analysis
- Socket回顾与I/0模型
- 老牌音乐播放器 WinAmp 发布 5.9 RC1 版:迁移到 VS 2019 完全重建,兼容 Win11
- AI automatic code writing plugin Copilot (co-pilot)
- "The core concept of" image classification and target detection in the positive and negative samples and understanding architecture
- Short-circuit characteristics and protection of SiC MOSFETs
- 21. Support Vector Machine - Introduction to Kernel Functions
- linux查看redis版本命令(linux查看mysql版本号)
猜你喜欢

Getting Started with Tkinter

AI automatic code writing plugin Copilot (co-pilot)

Recognize anomalies (you will understand after reading this)

Redis综述篇:与面试官彻夜长谈Redis缓存、持久化、淘汰机制、哨兵、集群底层原理!...

iNeuOS industrial Internet operating system, equipment operation and maintenance business and "low-code" form development tools

Shell 脚本 快速入门到实战 -02

高通cDSP简单编程例子(实现查询高通cDSP使用率、签名),RK3588 npu使用率查询

Made with Flutter and Firebase!counter application

Teach you how to deploy Nestjs projects
![[NLP] What is the memory of the model!](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[NLP] What is the memory of the model!
随机推荐
GAC Honda Safety Experience Camp: "Danger" is the best teacher
C language parsing json string (json object is converted to string)
ojdbc8 "Recommended Collection"Implementing a Simple Framework for Managing Object Information Using Reflection
Financial profitability and solvency indicators
Chapter VII
[Intensive reading of the paper] iNeRF
Quick Start Tutorial for flyway
npm 更改为淘宝镜像的方法[通俗易懂]
利用反射实现一个管理对象信息的简单框架
信息学奥赛一本通 1941:【07NOIP普及组】Hanoi双塔问题 | 洛谷 P1096 [NOIP2007 普及组] Hanoi 双塔问题
STM32 full series development firmware installation guide under Arduino framework
&lt;artifactId&gt;ojdbc8&lt;/artifactId&gt;「建议收藏」
ReentrantLock原理(未完待续)
sqlite3 simple operation
leetcode: 6135. The longest ring in the graph [inward base ring tree + longest ring board + timestamp]
老牌音乐播放器 WinAmp 发布 5.9 RC1 版:迁移到 VS 2019 完全重建,兼容 Win11
sqlite3简单操作
Linux environment redis cluster to build "recommended collection"
leetcode 665. Non-decreasing Array