1234567891011121314151617181920212223242526272829 |
- <script>
- export default {
- onLaunch: function() {
- const updateManager = uni.getUpdateManager()
- updateManager.onCheckForUpdate(function(res) {
- console.log(res.hasUpdate)
- })
- updateManager.onUpdateReady(function(res) {
- uni.showModal({
- title: '更新提示',
- content: '新版本已经准备好,是否重启小程序?',
- success(res) {
- if (res.confirm) {
- updateManager.applyUpdate()
- }
- }
- })
- })
- this.$store.dispatch('app/initDevice')
- }
- }
- </script>
- <style lang="scss">
- page {
- min-height: 100%;
- background: #f7f7f7;
- }
- </style>
|