NProgress是頁面跳轉出現在浏覽器頂部的進度條。
官網:http://ricostacruz.com/nprogress/
github:https://github.com/rstacruz/nprogress
安裝:
npm install --save nprogress
使用:
//導入
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
router.beforeEach((to, from, next) => {
NProgress.start()
next()
})
router.afterEach(() => {
NProgress.done()
})