demo form
This commit is contained in:
85
src/views/lists/domainlist.vue
Normal file
85
src/views/lists/domainlist.vue
Normal file
@@ -0,0 +1,85 @@
|
||||
<template>
|
||||
<div class="Domainlist">
|
||||
<h1>Domainlist</h1>
|
||||
<scroll-table :actions="actions" :columns="columns" :new-rows="newRows" :has-more="hasMore" :loading="loading" :handler="more" orderBy="Name" :orderDesc="false" :limit="50"></scroll-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ScrollTable from '../../components/scroll-table.vue';
|
||||
|
||||
export default {
|
||||
name: "Domainlist",
|
||||
components: {
|
||||
ScrollTable
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
actions: [{
|
||||
title: 'Edit',
|
||||
icon: 'icon-pencil',
|
||||
action(row) {
|
||||
console.log("yay edit", row);
|
||||
}
|
||||
}, {
|
||||
title: 'Duplicate',
|
||||
icon: 'icon-docs',
|
||||
action(row) {
|
||||
console.log("yay duplicate", row);
|
||||
}
|
||||
}, {
|
||||
title: 'Hide',
|
||||
icon: 'icon-eye-off',
|
||||
action(row) {
|
||||
console.log("yay hide", row);
|
||||
}
|
||||
}],
|
||||
columns: [{
|
||||
heading: 'ID',
|
||||
prop: 'ID',
|
||||
orderBy: 'id',
|
||||
align: 'right'
|
||||
}, {
|
||||
heading: 'TLD',
|
||||
prop: 'TLD',
|
||||
orderBy: 'tld',
|
||||
align: 'left'
|
||||
}, {
|
||||
heading: 'Domain',
|
||||
prop: 'Name',
|
||||
orderBy: 'name'
|
||||
}],
|
||||
newRows: [ ],
|
||||
hasMore: true,
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
more(offset, limit, orderBy, orderDesc, search) {
|
||||
this.loading = true;
|
||||
this.$store.dispatch('apiRequest', {
|
||||
endpoint: 'domains',
|
||||
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>
|
||||
Reference in New Issue
Block a user