当前位置:网站首页>The uniapp applet checks and prompts for updates
The uniapp applet checks and prompts for updates
2022-07-31 22:10:00 【Han Mo Ming Shang】
The code above:
xcxCheckUpdate.js
export default function xcxCheckUpdate(){const updateManager = uni.getUpdateManager();updateManager.onCheckForUpdate(function (res) {// Callback for requesting new version information});updateManager.onUpdateReady(function (res) {uni.showModal({title: 'Update Tips',content: 'The new version is ready, do you want to restart the application?',success(res) {if (res.confirm) {// The new version has been downloaded, call applyUpdate to apply the new version and restartupdateManager.applyUpdate();}}});});updateManager.onUpdateFailed(function (res) {// Failed to download new version});}
App.vue:
边栏推荐
- Implementing a Simple Framework for Managing Object Information Using Reflection
- 如何减少软件设计和实现之间鸿沟
- 基于RT1052 Aworks nanopb string 类型固定长度使用方式(二十七)
- 嵌入式开发没有激情了,正常吗?
- focus on!Haitai Fangyuan joins the "Personal Information Protection Self-discipline Convention"
- How to identify fake reptiles?
- linux查看redis版本命令(linux查看mysql版本号)
- Basic configuration of OSPFv3
- 「APIO2010」巡逻 题解
- 高效并发:Synchornized的锁优化详解
猜你喜欢
The principle of ReentrantLock (to be continued)
SiC MOSFET的短路特性及保护
统计UTF-8字符串中的字符函数
第六章
focus on!Haitai Fangyuan joins the "Personal Information Protection Self-discipline Convention"
The article you worked so hard to write may not be your original
A shortcut to search for specific character content in idea
Memblaze released the first enterprise-grade SSD based on long-lasting particles. What is the new value behind it?
Recognize anomalies (you will understand after reading this)
架构实战营模块八作业
随机推荐
NVIDIA has begun testing graphics products with AD106 and AD107 GPU cores
JS basic exercises
了解下C# 匿名方法
ThreadLocal
第七章
高通cDSP简单编程例子(实现查询高通cDSP使用率、签名),RK3588 npu使用率查询
useragent online lookup
Implementing a Simple Framework for Managing Object Information Using Reflection
Socket回顾与I/0模型
Golang must know the Go Mod command
MATLAB program design and application 2.4 Common internal functions of MATLAB
Learn about C# anonymous methods
嵌入式开发没有激情了,正常吗?
Unity-通过预制件和克隆方法动态实现各个UGUI下控件的创建和显示
What is Thymeleaf?How to use.
基于RT1052 Aworks nanopb string 类型固定长度使用方式(二十七)
Istio introduction
Several methods for deleting specified elements in Golang slices
信息学奥赛一本通 1941:【07NOIP普及组】Hanoi双塔问题 | 洛谷 P1096 [NOIP2007 普及组] Hanoi 双塔问题
GateWay implements load balancing