NProgress is a page jump is seen in the progress bar at the top of the browser
's official website: http://ricostacruz.com/nprogress/
GitHub: https://github.com/rstacruz/nprogress
Green progress bar is to NProgress
achieve results
installation
$ npm install --save nprogress 或者 $ yarn add nprogress //用法 NProgress.start(); NProgress.done();
use
//导入 import NProgress from 'nprogress' import 'nprogress/nprogress.css' router.beforeEach((to, from, next) => { NProgress.start() next() }) router.afterEach(() => { NProgress.done() })
In App.vue
the style
increase:
.bar {#nprogress background: Red ! Important; // custom color }