Nprogress-进度条

引入 nprogress

yarn add nprogress
import NProgress from 'nprogress'
import 'nprogress/nprogress.css' //这个样式必须引入

router.beforeEach((to,from,next) => {
  NProgress.start()
  next()
})

router.afterEach(() => {
  NProgress.done()
})

修改颜色

#nprogress .bar {
      background: red !important; //自定义颜色
    }
原文地址:https://www.cnblogs.com/lxz-blogs/p/13571341.html