管道基础大数据平台系统开发-【前端】-新系統界面
liupengpeng
2023-02-10 7302dadaba783c1346b47b40f533280d6c3e4fa2
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
<template>
  <div
    id="app"
 
  >
    <router-view />
  </div>
</template>
<script>
import { rotate } from 'ol/transform';
import router from './router';
export default {
  name: "App",
  computed: {},
  components: {},
  data() {
    return {};
  },
  created() {
  },
  mounted () {
    window.addEventListener('beforeunload', e => {
      sessionStorage.setItem('beforeunload', 1);
    });
    // 监听页面刷新
    if (sessionStorage.getItem('beforeunload') == 1) {
      let name = sessionStorage.getItem("routerName");
      if (name) {
        this.$nextTick(function () {
          this.$router.push({ path: name }); //如果sessionStorage存在路由,去缓存的路由
        })
      } else {
        this.$nextTick(function () {
         this.$router.push({ path: '/' });  //不存在存储,去主页
        })
      }
    }
  },
  beforeDestroy() { },
};
</script>
<style lang="less" scoped>
// #app {
//   font-family: Avenir, Helvetica, Arial, sans-serif;
//   -webkit-font-smoothing: antialiased;
//   -moz-osx-font-smoothing: grayscale;
//   text-align: center;
//   color: #2c3e50;
// }
#app {
  /*三角箭头的颜色*/
  scrollbar-arrow-color: #fff;
  /*滚动条滑块按钮的颜色*/
  scrollbar-face-color: #dfebff;
  /*滚动条整体颜色*/
  scrollbar-track-color: #536c97;
  
}
 
 
 
</style>