reordered for custom views

This commit is contained in:
Sebastian Frank
2017-08-29 15:51:50 +02:00
parent 5b250b02fe
commit f7de209197
10 changed files with 51 additions and 51 deletions

View File

@@ -0,0 +1,73 @@
<template>
<div class="Userlist">
<h1>Userlist</h1>
<scroll-table :columns="columns" :new-rows="newRows" :has-more="hasMore" :loading="loading" :handler="more" orderBy="id" :orderDesc="true"></scroll-table>
</div>
</template>
<script>
import ScrollTable from '../../components/scroll-table.vue';
export default {
name: "Userlist",
components: {
ScrollTable
},
data() {
return {
columns: [
{
heading: 'ID',
prop: 'ID',
orderBy: 'id'
},
{
heading: 'Benutzername',
prop: 'Username',
orderBy: 'username'
},
{
heading: 'Reseller',
prop: 'Reseller.Username'
},
{
heading: 'Render',
render(row) {
return 'ID:' + row.ID;
}
}
],
newRows: [ ],
hasMore: true,
loading: false
}
},
methods: {
more(offset, limit, orderBy, orderDesc, search) {
this.loading = true;
this.$store.dispatch('apiRequest', {
endpoint: 'users',
params: {
start: offset,
length: limit,
orderBy,
orderDesc,
search
}
})
.then(rows => {
this.hasMore = (rows.length >= limit);
this.newRows = rows;
this.loading = false;
})
.catch(error => {
this.loading = false;
this.hasMore = false;
console.log(error);
});
}
}
}
</script>