1.0.3 • Published 7 years ago

vue-list v1.0.3

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

Vue-List

A Vue.js component designed to handle common functionality needed when handling lists of data.

This is not ready for use in production

Setup

bootstrap.js file

/**
 * Vue is a modern JavaScript library for building interactive web interfaces
 * using reactive data binding and reusable components. Vue's API is clean
 * and simple, leaving you to focus on building your next great project.
 */
window.Vue = require('vue/dist/vue.js');

/**
 * We'll load the axios HTTP library which allows us to easily issue requests
 * to our Laravel back-end. This library automatically handles sending the
 * CSRF token as a header based on the value of the "XSRF" token cookie.
 */

window.axios = require('axios');

window.axios.defaults.headers.common = {
    'X-CSRF-TOKEN': window.Laravel.csrfToken,
    'X-Requested-With': 'XMLHttpRequest'
};

Vue.prototype.$http = axios;

app.js

var app = new Vue({
    el: '#app',
}).$mount();

Usage In Component

    import List from 'vue-list';

    export default {
        mixins: [List],
        mounted() {
            this.fetch(this.url)
        }
    });

Props

NameType
urlString

Data

NameType
itemsArray
paginationObject

Available Methods

MethodsParametersEvents Fired
fetchurlfetch:success, fetch:failed
storeitem, urlstore:success, store:failed
updateitem, urlupdate:success, update:failed
removeitem, urldelete:success, delete:failed
nextnonenone
prevnonenone
updatePaginationdatanone
1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago