App.vue 2.2 KB
<template>
  <div id="app" style="width:100%;height:100%">
    <router-view v-if="isRouterAlive"></router-view>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isRouterAlive: true
    }
  },
  provide() {
    return {
      reload: this.reload
    }
  },
  methods: {
    reload() {
      this.isRouterAlive = false;
      this.$nextTick(() => {
        this.isRouterAlive = true;
      })
    }
  },
  created() {
    // if (!window.localStorage.getItem('selectTab')) {
    // 	window.localStorage.setItem('selectTab', 'home')
    // }
    let webV = localStorage.getItem('webVersion');
    if (webV && webV !== 'undefined') {
      if (window._vionConfig.webVersion != webV) {
        localStorage.setItem('webVersion', window._vionConfig.webVersion);
        this.removeStorge();
        this.$router.push('/');
      } else {

      }
    } else {
      if (window._vionConfig.webVersion) {
        localStorage.setItem('webVersion', window._vionConfig.webVersion);
      }
    }
  },
  mounted() {
    let langObj = ['zh_CN', 'en_US', 'zh_TW']
    //if (this.$Project === 'store') {
      let _lang = localStorage.getItem('lang') || window.navigator.language;
      if (langObj.includes(_lang)) {
        _lang = _lang == 'mall_CN' ? 'zh_CN' : _lang;
      } else {
        if(_lang=='zh-TW'){
          _lang='zh_TW'
        }else if(_lang=='zh-CN'){
          _lang='zh_CN'
        }else{
          _lang='en_US'
        }
      }
      localStorage.setItem('lang', _lang)
    // } else {
    //   let _lang = 'mall_CN';
    //   localStorage.setItem('lang', _lang)
    // }
  }
}
</script>

<style>
  ::-webkit-scrollbar-thumb{

    background-color:#ccc;

    height:50px;

    outline-offset:-2px;

    outline:2px solid #fff;

    -webkit-border-radius:4px;

    border: 2px solid #fff;

  }

  /*---鼠标点击滚动条显示样式--*/

  ::-webkit-scrollbar-thumb:hover{

    background-color:#ccc;

    height:50px;

    -webkit-border-radius:4px;

  }

  /*---滚动条大小--*/

  ::-webkit-scrollbar{

    width:10px !important;

    height:10px !important;

  }

  /*---滚动框背景样式--*/

  ::-webkit-scrollbar-track-piece{

    background-color:#fff;

    -webkit-border-radius:0;

  }
</style>