npm i @tigerbui/i-table-vuetifyjs@latest
<script setup lang="ts">
import ITableVuetify from "@tigerbui/i-table-vuetifyjs";
import { ref } from "vue";
const desserts = ref<any[]>([]);
Array.from({ length: 200 }, (_, _id: number) => {
const floor: string = Math.floor(Math.random() * _id).toFixed(2);
const Int: number = Math.ceil(Math.random() * _id);
desserts.value.push({
name: `Name ${_id}`,
calories: Int,
fat: floor,
carbs: Int,
protein: floor,
iron: floor,
});
});
const headers = ref<any[]>([
{
title: "Dessert (100g serving)",
align: "start",
sortable: false,
key: "name",
},
{ title: "Calories", key: "calories", align: "end" },
{ title: "Fat (g)", key: "fat", align: "end" },
{ title: "Carbs (g)", key: "carbs", align: "end" },
{ title: "Protein (g)", key: "protein", align: "end" },
{ title: "Iron (%)", key: "iron", align: "end" },
]);
</script>
<template>
<h1>Demo Vu3</h1>
<ITableVuetify
:headers="headers"
:items="desserts"
show-select
></ITableVuetify>
</template>