<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
      this.updateMiniProgram()
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
    methods: {
      // 强制升级
      updateMiniProgram() {
        const updateManager = uni.getUpdateManager()
        updateManager.onUpdateReady(function () {
          uni.showModal({
            title: '更新提示',
            content: '新版本已经准备好，是否重启应用？',
            showCancel: false,
            success: function () {
              updateManager.applyUpdate()
            }
          })
        })
      }
    }
	}
</script>

<style lang="scss">
  @import "uview-plus/index.scss";
</style>
