forked from mirrors/homebox
feat: implement selectable view + sortable table (#264)
This commit is contained in:
parent
f36f17b57d
commit
bd933af874
5 changed files with 68 additions and 72 deletions
|
@ -1,5 +1,3 @@
|
|||
import { TableHeader } from "~~/components/global/Table.types";
|
||||
|
||||
import { UserClient } from "~~/lib/api/user";
|
||||
|
||||
export function itemsTable(api: UserClient) {
|
||||
|
@ -11,31 +9,8 @@ export function itemsTable(api: UserClient) {
|
|||
return data.items;
|
||||
});
|
||||
|
||||
const headers = [
|
||||
{
|
||||
text: "Name",
|
||||
sortable: true,
|
||||
value: "name",
|
||||
},
|
||||
{
|
||||
text: "Location",
|
||||
value: "location.name",
|
||||
},
|
||||
{
|
||||
text: "Warranty",
|
||||
value: "warranty",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
text: "Price",
|
||||
value: "purchasePrice",
|
||||
align: "center",
|
||||
},
|
||||
] as TableHeader[];
|
||||
|
||||
return computed(() => {
|
||||
return {
|
||||
headers,
|
||||
items: items.value || [],
|
||||
};
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue