1、安装
npm install --save nprogress
2、在main.js中引入
import NProgress from "nprogress"
import "nprogress/nprogress.css"
3、在main.js中使用
路由跳转有progress,加在vue-router的beforeEach和afterEach中
router.beforeEach((to,from,next) => {
NProgress.start()
next()
})
router.afterEach(() => {
NProgress.done()
})
插件API:https://blog.csdn.net/u012369749/article/details/62422113
转载于:https://www.cnblogs.com/YAN-HUA/p/9640202.html