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

Commit 7671e61

Browse files
committed
Modified example and exported only server side component
1 parent 791eee2 commit 7671e61

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

src/App.vue

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script>
2-
import Datasource from './components/Datasource.vue'
3-
import axios from 'axios'
2+
import Datasource from './components/ServerDatasource.vue'
43
export default {
54
name: 'app',
65
components: {
@@ -9,13 +8,10 @@ export default {
98
render (h) {
109
return (
1110
<div id="app">
12-
<datasource table-data={this.information} limits={this.limits} actions={this.actions} columns={this.columns} pagination={this.pagination} onChange={this.change} onSearching={this.searching}></datasource>
11+
<datasource source="http://young-falls-97690.herokuapp.com/getusers" limits={this.limits} actions={this.actions} columns={this.columns}></datasource>
1312
</div>
1413
)
1514
},
16-
mounted () {
17-
this.getData()
18-
},
1915
data () {
2016
return {
2117
information: [],
@@ -102,16 +98,6 @@ export default {
10298
}
10399
},
104100
methods: {
105-
async getData () {
106-
await axios.get(`http://young-falls-97690.herokuapp.com/getusers?per_page=${this.perpage}&page=${this.page}&search=${this.search}`)
107-
.then((response) => {
108-
this.pagination = response.data.pagination
109-
this.information = response.data.data
110-
})
111-
.catch((error) => {
112-
console.error(error)
113-
})
114-
},
115101
change (value) {
116102
this.page = value.page
117103
this.perpage = value.perpage

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import Datasource from 'src/components/Datasource.vue'
1+
import ServerDatasource from 'src/components/ServerDatasource.vue'
22

3-
export { Datasource }
3+
export { ServerDatasource }

0 commit comments

Comments
 (0)