wx-starlock/App.vue

35 lines
801 B
Vue
Raw Normal View History

2024-08-06 09:40:20 +08:00
<script>
export default {
onLaunch: function() {
console.log('App Launch')
2024-08-06 11:07:48 +08:00
this.updateMiniProgram()
2024-08-06 09:40:20 +08:00
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
2024-08-06 11:07:48 +08:00
},
methods: {
// 强制升级
updateMiniProgram() {
const updateManager = uni.getUpdateManager()
updateManager.onUpdateReady(function () {
uni.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
showCancel: false,
success: function () {
updateManager.applyUpdate()
}
})
})
}
}
2024-08-06 09:40:20 +08:00
}
</script>
2024-08-06 10:57:56 +08:00
<style lang="scss">
@import "uview-plus/index.scss";
</style>