实现效果:
1、安装
NProgress可以通过npm安装
npm install --save nprogress
2、在index.ts中配置
import NProgress from 'nprogress';
import 'nprogress/nprogress.css'
NProgress.configure({
ease: "ease",
speed: 500,
})
//路由前置守卫
router.beforeEach((to, from, next) => {
// console.log(to)
NProgress.start()
})
//路由后置守卫
router.afterEach((to, from) => {
// console.log(to)
NProgress.done()
})
标签:vue,console,log,进度条,ease,NProgress,import,Nprogress,nprogress
From: https://blog.csdn.net/or77iu_N/article/details/143735934