0.0.9 • Published 7 years ago

@aventure-cloud/vuejs-axios-bridge v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

Vuejs Axios Bridge

Axios plugin with progress bar and autenthication configuration

Dependencies

Plugin ship with NProgress as progress bar module integrated by default.

Install

npm i -S @aventure-cloud/vuejs-axios-bridge

Integrate in your project

You can inject a configuration object with two main properties:

  • axios for axios configuration
  • progress for NProgress configuration

To discover all passible configuration of this two module read their official documentation.

import AxiosPlugin from '@aventure-cloud/vuejs-axios-bridge';
Vue.use(AxiosPlugin, {
    axios: {
        baseURL: 'api',
        headers: {
            'Authorization': 'Bearer ' + User.api_token
        }
    },
    progress: {
        showSpinner: true
    }
});

Add nprogress style

Import nprogress style in your sass:

@import "../node_modules/@aventure-cloud/vuejs-axios-bridge/assets/nprogress";

Use

export default {
    data(){
        return {
            items: []
        };
    },
    
    mounted(){
        this.$axios.get('items')
            .then(response => {
                this.items = response.data;
            });
    }
    
}

Disable progress bar

If you don't want use a progress bar you can disable it:

import AxiosPlugin from '@aventure-cloud/vuejs-axios-bridge';
Vue.use(AxiosPlugin, {
    axios: {
        ...
    },
    progress: false
})
0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago