App.vue
1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!--
* @Date: 2022-07-25 11:04:45
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-04-29 10:53:39
* @FilePath: /custom_dashboard/src/App.vue
* @Description: 文件描述
-->
<template>
<div>
<router-view />
</div>
</template>
<script>
import { wxInfo } from '@/utils/tools'
import { Updater } from '@/utils/versionUpdater'
export default {
components: { },
mounted () {
// 正式环境
// TAG:检查是否更新
if (import.meta.env.PROD) {
const upDater = new Updater({
time: 30000
})
upDater.on('no-update', () => {
// console.log('还没更新')
})
upDater.on('update', () => {
// console.log('已经更新了,请刷新页面')
this.$confirm('检测到新版本,是否刷新?', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
window.location.reload();
}).catch(() => {
});
})
}
},
data () {
return {
}
}
}
</script>
<style lang="less">
* {
outline: none;
}
// 隐藏浏览器自带滚动条
// *::-webkit-scrollbar {
// display: none;
// }
// * {
// scrollbar-width: none;
// }
// * {
// -ms-overflow-style: none;
// }
//
html,
body {
font-size: 16px;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
p {
margin: 0;
padding: 0;
}
}
.global-center {
position: relative;
top: 50%;
transform: translateY(-50%);
}
.nav-bar {
background-color: #2B000C;
color: #D4D4D4;
}
</style>