App.vue 1.55 KB
<!--
 * @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>