Vue 页面加载进度条

页面加载进度条

安装

1
npm install --save nprogress

配置

mian.js

1
2
3
4
5
6
7
8
9
10
11
12
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'

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

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