管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-02-11 d5efa1b1cdbab10b034357ae3e7b65c21754a123
src/App.vue
@@ -1,5 +1,8 @@
<template>
  <div id="app">
  <div
    id="app"
  >
    <router-view />
  </div>
</template>
@@ -14,12 +17,31 @@
    return {};
  },
  created() {
  },
  beforeDestroy() {},
  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">
<style lang="less" scoped>
// #app {
//   font-family: Avenir, Helvetica, Arial, sans-serif;
//   -webkit-font-smoothing: antialiased;
@@ -34,14 +56,9 @@
  scrollbar-face-color: #dfebff;
  /*滚动条整体颜色*/
  scrollbar-track-color: #536c97;
}
// ::-webkit-scrollbar-thumb {
//   //滑块部分
//   background-color: #dfebff;
// }
// ::-webkit-scrollbar-track {
//   //轨道部分
//   box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
//   background: #536c97;
// }
</style>