Changed Customers to Multi Page with Route Params to add mobile performance

This commit is contained in:
2023-12-06 22:06:57 +01:00
parent 987f8a0bec
commit ce3a013f86
4 changed files with 333 additions and 291 deletions

View File

@@ -0,0 +1,49 @@
<template>
<div id="main">
<!-- TODO: Kontakte erstellen und dem Kunden zuweisen -->
<UButton @click="router.push(`/customers/create/`)">+ Kunde</UButton>
<UTable
:rows="customers"
:columns="customerColumns"
@select="selectCustomer"
/>
</div>
</template>
<script setup>
definePageMeta({
middleware: "auth"
})
const router = useRouter()
const {customers } = storeToRefs(useDataStore())
const mode = ref("show")
const customerColumns = [
{
key: 'customerNumber',
label: "Kundennr.",
sortable: true
},
{
key: "name",
label: "Name",
sortable: true
}
]
const selectCustomer = (customer) => {
console.log(customer)
router.push(`/customers/show/${customer.id} `)
}
</script>
<style scoped>
</style>