@@ -31,50 +31,37 @@ $ npm install git+https://git@github.com/coderdiaz/vue-datasource#2.0.0
3131
3232``` html
3333<div id =" #app" >
34- <datasource
35- language =" en"
36- :table-data =" information.data"
34+ <server-datasource
35+ source =" api_url"
3736 :columns =" columns"
38- :pagination =" information.pagination"
39- :actions =" actions"
40- v-on:change =" changePage"
41- v-on:searching =" onSearch" ></datasource >
37+ :actions =" actions" ></server-datasource >
4238</div >
4339```
4440
4541``` javascript
46- import Datasource from ' vue-datasource'
42+ import { ServerDatasource } from ' vue-datasource'
4743
4844new Vue ({
4945 el: ' #app' ,
5046 components: {
51- Datasource
47+ ServerDatasource
5248 },
5349 data () {
5450 return {
55- information: {
56- pagination: {... },
57- data: [... ]
58- },
5951 columns: [... ],
6052 actions: [... ]
6153 }
62- },
63- methods: {
64- changePage (values ) {... },
65- onSearch (searchQuery ) {... }
6654 }
6755});
6856```
6957
7058### Available Props
7159| Prop | Type | Default | Description |
7260| -------------| ---------| ----------------| -------------------------------------------------------------|
73- | table-data | Array | | Table information |
61+ | source | String | | API Url to get data |
7462| translation | Object | [ Object] | Defines the table labels language ([ structure] ( #translation-structure ) ) |
7563| limits | Array | [ 1,5,10,15,20] | Defines the limits to display |
7664| columns | Array | | Columns to display |
77- | pagination | Object | | Pagination information about the table data ([ structure] ( #pagination-structure ) ) |
7865| actions | Array | | Action buttons ([ structure] ( #action-event-sctructure ) ) |
7966
8067### Available Events
@@ -144,21 +131,6 @@ This callback will modify the data for various operations. Such as applying a sp
144131}
145132```
146133
147- ### Pagination Structure
148- ``` javascript
149- {
150- ... ,
151- pagination: {
152- total: 25 , // Number of total rows (default 0)
153- per_page: 15 , // Number of rows to show (default 15)
154- current_page: 1 , // Actual page
155- last_page: 2 , // Last page
156- from: 1 , // Beginning of visible rows
157- to: 15 // End of visible rows
158- }
159- }
160- ```
161-
162134### Translation Structure
163135``` javascript
164136{
@@ -194,6 +166,10 @@ This callback will modify the data for various operations. Such as applying a sp
194166 ]
195167}
196168```
169+
170+ ### Buy me a coffee
171+ [ Give me thanks] ( http://paypal.me/coderdiaz )
172+
197173### Development
198174
199175``` bash
@@ -227,6 +203,9 @@ For detailed explanation on how things work, checkout the [guide](http://vuejs-t
227203### Contributions
228204All contributions are welcome send your PR and Issues.
229205
206+ ### Greatings
207+ [ Vue Spinner by Greyby] ( https://github.com/greyby/vue-spinner )
208+
230209### License
231210This is a open-source software licensed under the [ MIT license] ( https://raw.githubusercontent.com/coderdiaz/vue-datasource/master/LICENSE )
232211
0 commit comments