@@ -3,13 +3,10 @@ import axios from 'axios'
3
3
import _ from ' lodash'
4
4
import DatasourceUtils from ' ../utils/DatasourceUtils'
5
5
import Pagination from ' ./Pagination.vue'
6
- import MoonLoader from ' vue-spinner/src/MoonLoader.vue'
7
6
import { EventBus } from ' ../utils/EventBus'
8
7
export default {
9
8
name: ' ServerDatasource' ,
10
- components: {
11
- Pagination, MoonLoader
12
- },
9
+ components: {Pagination},
13
10
render (h ) {
14
11
return (
15
12
< div class = " vue-server-datasource" >
@@ -42,7 +39,6 @@ export default {
42
39
< / tr>
43
40
< / tbody>
44
41
< / table>
45
- { this .spinnerItem }
46
42
< / div>
47
43
< div class = " panel-footer" >
48
44
< div class = " pull-left btn-group btn-group-actions" >
@@ -124,7 +120,6 @@ export default {
124
120
return {
125
121
perpage: 10 ,
126
122
tableData: [],
127
- loading: false ,
128
123
selected: null , // row and Object selected on click event
129
124
indexSelected: - 1 , // index row selected on click event
130
125
search: ' ' , // word to search in the table,
@@ -138,13 +133,6 @@ export default {
138
133
}
139
134
},
140
135
computed: {
141
- spinnerItem () {
142
- if (this .loading ) {
143
- return < div class = " vue-spinner-wrapper" >
144
- < moon- loader>< / moon- loader>
145
- < / div>
146
- }
147
- },
148
136
limitOptions () {
149
137
return this .limits .map ((limit , index ) => {
150
138
return < option value= { limit } selected= { parseInt (this .perpage ) === parseInt (limit) }> { limit }< / option>
@@ -203,16 +191,13 @@ export default {
203
191
this .$emit (' searching' , this .search )
204
192
},
205
193
setData () {
206
- this .loading = true
207
194
axios .get (` ${ this .source } ?per_page=${ this .perpage } &page=${ this .pagination .current_page } &search=${ this .search } ` )
208
195
.then ((response ) => {
209
- this .loading = false
210
196
this .tableData = response .data .data
211
197
this .pagination = response .data .pagination
212
198
this .perpage = this .pagination .per_page
213
199
})
214
200
.catch ((error ) => {
215
- this .loading = false
216
201
console .warn (` [VueDatasource] ${ error} ` )
217
202
})
218
203
}
0 commit comments