当前位置:网站首页>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>边栏推荐
- linux view redis version command (linux view mysql version number)
- 【AcWing】The 62nd Weekly Match 【2022.07.30】
- grep command written test questions
- grep命令 笔试题
- Implementation of a sequence table
- 20. Support vector machine - knowledge of mathematical principles
- -xms -xmx(information value)
- BOW/DOM (top)
- Collation of knowledge points in Ningbo University NBU IT project management final exam
- Implementing a Simple Framework for Managing Object Information Using Reflection
猜你喜欢

Chapter VII

Flink_CDC construction and simple use

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

关注!海泰方圆加入《个人信息保护自律公约》

Realization of character makeup

Audio alignment using cross-correlation

【公开课预告】:超分辨率技术在视频画质增强领域的研究与应用

useragent online lookup

idea中搜索具体的字符内容的快捷方式

Bika LIMS open source LIMS set - use of SENAITE (detection process)
随机推荐
NVIDIA has begun testing graphics products with AD106 and AD107 GPU cores
Judging decimal points and rounding of decimal operations in Golang
Douyin fetches video list based on keywords API
Shell 脚本 快速入门到实战 -02
&lt;artifactId&gt;ojdbc8&lt;/artifactId&gt;「建议收藏」
-xms -xmx(information value)
leetcode: 6135. The longest ring in the graph [inward base ring tree + longest ring board + timestamp]
Quick Start Tutorial for flyway
OSPFv3的基本配置
IDA PRO中汇编结构体识别
Collation of knowledge points in Ningbo University NBU IT project management final exam
[PIMF] OpenHarmony Thesis Club - Inventory of the open source Hongmeng tripartite library [3]
renderjs usage in uni-app
What is Thymeleaf?How to use.
Batch (batch size, full batch, mini batch, online learning), iterations and epochs in deep learning
leetcode 665. Non-decreasing Array 非递减数列(中等)
The whole network is on the verge of triggering, and the all-round assistant for content distribution from media people - Rongmeibao
SiC MOSFET的短路特性及保护
linux view redis version command (linux view mysql version number)
C程序设计-方法与实践(清华大学出版社)习题解析