Add current state of the Vue frontend
This commit is contained in:
29
vue/src/views/Customers.vue
Normal file
29
vue/src/views/Customers.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="error">{{ error }}</div>
|
||||
<EntityList :columns="['id', 'number', 'prefix']" link-column="id" :entities="customers" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HSAdmin from "../hsadmin";
|
||||
import EntityList from "../components/EntityList";
|
||||
|
||||
export default {
|
||||
name: "Customers",
|
||||
components: {EntityList},
|
||||
data () { return {
|
||||
error: false,
|
||||
customers: [],
|
||||
}},
|
||||
props: { hsadmin: HSAdmin },
|
||||
created () { this.fetch() },
|
||||
watch: { "$route": "fetch" },
|
||||
methods: {
|
||||
async fetch () {
|
||||
const res = await this.hsadmin.get("customers");
|
||||
this.customers = res.data;
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
Reference in New Issue
Block a user