vrn

vue-resource-nprogress

An interceptor that adds progressbar to all requests

Showing:

Popularity

Downloads/wk

15

GitHub Stars

11

Maintenance

Last Commit

5yrs ago

Contributors

0

Package

Dependencies

0

Size (min+gzip)

0.7KB

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

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-nprogress

Then 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 installed globally. A example of this is adding nprogress plugin in <script> in <head>

Using CommonJS

npm i nprogress
import NProgress from 'nprogress'
window.NProgress = NProgress
require('nprogress/nprogress.css')

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.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100