Skip to content
This repository was archived by the owner on Jun 10, 2021. It is now read-only.

fix/remove-loader #47

Merged
merged 3 commits into from
Oct 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,7 @@ For detailed explanation on how things work, checkout the [guide](http://vuejs-t
### Contributions
All contributions are welcome send your PR and Issues.

### Greatings
[Vue Spinner by Greyby](https://github.com/greyby/vue-spinner)

### License
This is a open-source software licensed under the [MIT license](https://raw.githubusercontent.com/coderdiaz/vue-datasource/master/LICENSE)

##### Created by Javier Diaz. Translation by [itsuwaribito](https://github.com/itsuwaribito)
##### Crafted by Javier Diaz. Translation by [itsuwaribito](https://github.com/itsuwaribito)
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
"dependencies": {
"axios": "^0.16.1",
"lodash": "^4.17.4",
"vue": "^2.2.6",
"vue-spinner": "^1.0.2"
"vue": "^2.2.6"
},
"devDependencies": {
"autoprefixer": "^6.7.2",
Expand Down
17 changes: 1 addition & 16 deletions src/components/ServerDatasource.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ import axios from 'axios'
import _ from 'lodash'
import DatasourceUtils from '../utils/DatasourceUtils'
import Pagination from './Pagination.vue'
import MoonLoader from 'vue-spinner/src/MoonLoader.vue'
import { EventBus } from '../utils/EventBus'
export default {
name: 'ServerDatasource',
components: {
Pagination, MoonLoader
},
components: {Pagination},
render (h) {
return (
<div class="vue-server-datasource">
Expand Down Expand Up @@ -42,7 +39,6 @@ export default {
</tr>
</tbody>
</table>
{ this.spinnerItem }
</div>
<div class="panel-footer">
<div class="pull-left btn-group btn-group-actions">
Expand Down Expand Up @@ -124,7 +120,6 @@ export default {
return {
perpage: 10,
tableData: [],
loading: false,
selected: null, // row and Object selected on click event
indexSelected: -1, // index row selected on click event
search: '', // word to search in the table,
Expand All @@ -138,13 +133,6 @@ export default {
}
},
computed: {
spinnerItem () {
if (this.loading) {
return <div class="vue-spinner-wrapper">
<moon-loader></moon-loader>
</div>
}
},
limitOptions () {
return this.limits.map((limit, index) => {
return <option value={ limit } selected={ parseInt(this.perpage) === parseInt(limit) }>{ limit }</option>
Expand Down Expand Up @@ -203,16 +191,13 @@ export default {
this.$emit('searching', this.search)
},
setData () {
this.loading = true
axios.get(`${this.source}?per_page=${this.perpage}&page=${this.pagination.current_page}&search=${this.search}`)
.then((response) => {
this.loading = false
this.tableData = response.data.data
this.pagination = response.data.pagination
this.perpage = this.pagination.per_page
})
.catch((error) => {
this.loading = false
console.warn(`[VueDatasource] ${error}`)
})
}
Expand Down