Package Exports
- vue-resource-nprogress
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vue-resource-nprogress) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
vue-resource-nprogress
This is a fork of vue-resource-progressbar-interceptor but instead of using vue-progressbar, this plugin uses nprogress
Module attaches interceptors to vue instance which controls progressbar on top of the screen.
Installation
$ npm i vue-resource-nprogressThen in your code:
const Vue = require('vue');
const VueResource = require('vue-resource');
const VueResourceNProgress = require('vue-resource-nprogress');
Vue.use(VueResource);
Vue.use(VueResourceNProgress);NOTE: You should have NProgress set globally (A example to add nprogress plugin in <script> in <head>)
Configuration
By default progressbar shows for every single request.
In order not to use progressbar for certain requests, use showProgressBar parameter in request.
Like this:
Vue.http.get('/url', { showProgressBar: false })Configuration options:
Vue.use(VueResourceProgressBarInterceptor, {
latencyThreshold: 100, // Number of ms before progressbar starts showing, 100 is default
});Notes
This plugin was inspired by this angular.js version.