将此函数放到app.js中,在onLaunch 过程中调用 this.checkForUpdate()
//*检查微信小程序是否最新版本*//
checkForUpdate: function () {
const updateManager = wx.getUpdateManager()
updateManager.onUpdateReady(function () {
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success: function (res) {
if (res.confirm) {
updateManager.applyUpdate()
}
}
})
})
updateManager.onUpdateFailed(function () { })
},
290

被折叠的 条评论
为什么被折叠?



