Nuxt3 Typescript Simple Datatable that handles dynamic row content with generic typing
- Table
- Generic typing
- Dynamic row content
- Add
@creatiwity/datatabledependency to your project
# Using pnpm pnpm add @creatiwity/datatable # Using yarn yarn add @creatiwity/datatable # Using npm npm install @creatiwity/datatable- Add
@creatiwity/datatableto themodulessection ofnuxt.config.ts
export default defineNuxtConfig({ modules: ["@creatiwity/datatable"], });That's it! You can now use Creat Datatable in your Nuxt app ✨
const dataTableInfos = { headers: [ { id: "name", label: "Nom", }, ], data: [{ name: "Toto" }, { name: "Tata" }], };<CreatDatable id="creat-datatable" :infos="dataTableInfos"> <template #name="category"> <strong>{{ category.data.name }}</strong> </template> </CreatDatable>