0.0.9 • Published 6 years ago

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

Weekly downloads
-
License
MIT
Repository
github
Last release
6 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

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago