Skip to content

ta7sudan/apiz-vue

Repository files navigation

@lowb/apiz-vue

A vue plugin for apiz

Installation

$ npm i -P @lowb/apiz-vue

Usage

import APIs from '@lowb/apiz-vue';
import Vue from 'vue';

Vue.use(APIs);

const apis = new APIs({
    meta: {
        getBooks: {
            path: '/book'
        }
    },
    retry: 1,
    beforeSend() {},
    afterResponse() {}
});

new Vue({
    apis
});
// or
new Vue({
    apis: {
        name: '$http',
        apiGroup: apis
    }
});
// or
new Vue({
    apis: [{
        name: '$group0',
        apiGroup: apis
    }, {
        name: '$group1',
        apiGroup: apis
    }]
});

Options