vben
2021-01-27 733afddd19523550d8c7df5c523a0b0929afc608
perf(nprocess): remove nprocess css
3个文件已修改
32 ■■■■■ 已修改文件
src/design/index.less 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/design/public.less 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/guard/progressGuard.ts 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/design/index.less
@@ -52,12 +52,6 @@
  }
}
// remove the clear button of a text input control in IE10+
input::-ms-clear,
input::-ms-reveal {
  display: none;
}
body {
  font-family: 'BlinkMacSystemFont,segoe ui,Microsoft YaHei,Arial,sans-serif,Helvetica Neue,Helvetica,Pingfang SC,Hiragino Sans GB,Roboto,helvetica neue,Arial,noto sans,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol,noto color emoji';
  font-style: normal;
src/design/public.less
@@ -24,3 +24,21 @@
::-webkit-scrollbar-thumb:hover {
  background: @border-color-dark;
}
// =================================
// ==============nprogress==========
// =================================
#nprogress {
  pointer-events: none;
  .bar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99999;
    width: 100%;
    height: 2px;
    background-color: @primary-color;
    opacity: 0.75;
  }
}
src/router/guard/progressGuard.ts
@@ -2,8 +2,8 @@
import { useTransitionSetting } from '/@/hooks/setting/useTransitionSetting';
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
import nProgress from 'nprogress';
import { unref } from 'vue';
const { getOpenNProgress } = useTransitionSetting();
@@ -11,13 +11,13 @@
export function createProgressGuard(router: Router) {
  router.beforeEach(async (to) => {
    if (to.meta.loaded) return true;
    unref(getOpenNProgress) && NProgress.start();
    unref(getOpenNProgress) && nProgress.start();
    return true;
  });
  router.afterEach(async (to) => {
    if (to.meta.loaded) return true;
    unref(getOpenNProgress) && NProgress.done();
    unref(getOpenNProgress) && nProgress.done();
    return true;
  });
}