当前位置:网站首页>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>边栏推荐
- 请问我的这段sql中sql语法哪里出了错
- useragent online lookup
- Implementation of a sequence table
- 每月一书(202207):《Swift编程权威指南》
- Transfer Learning - Domain Adaptation
- "The core concept of" image classification and target detection in the positive and negative samples and understanding architecture
- Structure of the actual combat battalion module eight operations
- How to identify fake reptiles?
- Several methods of mysql backup table
- Efficient Concurrency: A Detailed Explanation of Synchornized's Lock Optimization
猜你喜欢

Chapter VII

第七章

How to debug TestCafe

The whole network is on the verge of triggering, and the all-round assistant for content distribution from media people - Rongmeibao
![leetcode: 6135. The longest ring in the graph [inward base ring tree + longest ring board + timestamp]](/img/91/284de3dcbb8d143d85775b314dd41c.png)
leetcode: 6135. The longest ring in the graph [inward base ring tree + longest ring board + timestamp]

NVIDIA has begun testing graphics products with AD106 and AD107 GPU cores

AI 自动写代码插件 Copilot(副驾驶员)

顺序表的实现
![[Code Hoof Set Novice Village 600 Questions] Merge two numbers without passing a character array](/img/4d/038e6cd6ecad19934122cff89f4d76.png)
[Code Hoof Set Novice Village 600 Questions] Merge two numbers without passing a character array

OSPFv3的基本配置
随机推荐
leetcode 665. Non-decreasing Array
Basic configuration of OSPFv3
[NLP] What is the memory of the model!
高通cDSP简单编程例子(实现查询高通cDSP使用率、签名),RK3588 npu使用率查询
PCB叠层设计
How to debug TestCafe
关注!海泰方圆加入《个人信息保护自律公约》
深度学习中的batch(batch size,full batch,mini batch, online learning)、iterations与epoch
What is Thymeleaf?How to use.
C language parsing json string (json object is converted to string)
Mobile web development 02
A shortcut to search for specific character content in idea
spark reports an error OutOfMemory "recommended collection"
In Golang go-redis cluster mode, new connections are constantly created, and the problem of decreased efficiency is solved
Collation of knowledge points in Ningbo University NBU IT project management final exam
TestCafeSummary
Bika LIMS open source LIMS set - use of SENAITE (detection process)
Efficient Concurrency: A Detailed Explanation of Synchornized's Lock Optimization
Returns a zero-length array or empty collection, do not return null
Short-circuit characteristics and protection of SiC MOSFETs