feat: implement selectable view + sortable table (#264)

This commit is contained in:
Hayden 2023-02-05 14:00:33 -09:00 committed by GitHub
parent f36f17b57d
commit bd933af874
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 68 additions and 72 deletions

View file

@ -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 || [],
};
});