doc: added doc examples
This commit is contained in:
@@ -1,44 +1,42 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="vp-raw flex flex-col">
|
<Table>
|
||||||
<Table>
|
<table-head>
|
||||||
<table-head>
|
<table-head-cell>Product name</table-head-cell>
|
||||||
<table-head-cell>Product name</table-head-cell>
|
<table-head-cell>Color</table-head-cell>
|
||||||
<table-head-cell>Color</table-head-cell>
|
<table-head-cell>Category</table-head-cell>
|
||||||
<table-head-cell>Category</table-head-cell>
|
<table-head-cell>Price</table-head-cell>
|
||||||
<table-head-cell>Price</table-head-cell>
|
<table-head-cell><span class="sr-only">Edit</span></table-head-cell>
|
||||||
<table-head-cell><span class="sr-only">Edit</span></table-head-cell>
|
</table-head>
|
||||||
</table-head>
|
<table-body>
|
||||||
<table-body>
|
<table-row>
|
||||||
<table-row>
|
<table-cell>Apple MacBook Pro 17"</table-cell>
|
||||||
<table-cell>Apple MacBook Pro 17"</table-cell>
|
<table-cell>Sliver</table-cell>
|
||||||
<table-cell>Sliver</table-cell>
|
<table-cell>Laptop</table-cell>
|
||||||
<table-cell>Laptop</table-cell>
|
<table-cell>$2999</table-cell>
|
||||||
<table-cell>$2999</table-cell>
|
<table-cell>
|
||||||
<table-cell>
|
<a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
||||||
<a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
</table-cell>
|
||||||
</table-cell>
|
</table-row>
|
||||||
</table-row>
|
<table-row>
|
||||||
<table-row>
|
<table-cell>Microsoft Surface Pro</table-cell>
|
||||||
<table-cell>Microsoft Surface Pro</table-cell>
|
<table-cell>White</table-cell>
|
||||||
<table-cell>White</table-cell>
|
<table-cell>Laptop PC</table-cell>
|
||||||
<table-cell>Laptop PC</table-cell>
|
<table-cell>$1999</table-cell>
|
||||||
<table-cell>$1999</table-cell>
|
<table-cell>
|
||||||
<table-cell>
|
<a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
||||||
<a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
</table-cell>
|
||||||
</table-cell>
|
</table-row>
|
||||||
</table-row>
|
<table-row>
|
||||||
<table-row>
|
<table-cell>Magic Mouse 2</table-cell>
|
||||||
<table-cell>Magic Mouse 2</table-cell>
|
<table-cell>Black</table-cell>
|
||||||
<table-cell>Black</table-cell>
|
<table-cell>Accessories</table-cell>
|
||||||
<table-cell>Accessories</table-cell>
|
<table-cell>$99</table-cell>
|
||||||
<table-cell>$99</table-cell>
|
<table-cell>
|
||||||
<table-cell>
|
<a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
||||||
<a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
</table-cell>
|
||||||
</table-cell>
|
</table-row>
|
||||||
</table-row>
|
</table-body>
|
||||||
</table-body>
|
</Table>
|
||||||
</Table>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { Table, TableHead, TableBody, TableHeadCell, TableRow, TableCell } from '../../../../src/index'
|
import { Table, TableHead, TableBody, TableHeadCell, TableRow, TableCell } from '../../../../src/index'
|
||||||
|
|||||||
43
docs/components/table/examples/TableHoverableExample.vue
Normal file
43
docs/components/table/examples/TableHoverableExample.vue
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<template>
|
||||||
|
<Table hoverable>
|
||||||
|
<table-head>
|
||||||
|
<table-head-cell>Product name</table-head-cell>
|
||||||
|
<table-head-cell>Color</table-head-cell>
|
||||||
|
<table-head-cell>Category</table-head-cell>
|
||||||
|
<table-head-cell>Price</table-head-cell>
|
||||||
|
<table-head-cell><span class="sr-only">Edit</span></table-head-cell>
|
||||||
|
</table-head>
|
||||||
|
<table-body>
|
||||||
|
<table-row>
|
||||||
|
<table-cell>Apple MacBook Pro 17"</table-cell>
|
||||||
|
<table-cell>Sliver</table-cell>
|
||||||
|
<table-cell>Laptop</table-cell>
|
||||||
|
<table-cell>$2999</table-cell>
|
||||||
|
<table-cell>
|
||||||
|
<a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
||||||
|
</table-cell>
|
||||||
|
</table-row>
|
||||||
|
<table-row>
|
||||||
|
<table-cell>Microsoft Surface Pro</table-cell>
|
||||||
|
<table-cell>White</table-cell>
|
||||||
|
<table-cell>Laptop PC</table-cell>
|
||||||
|
<table-cell>$1999</table-cell>
|
||||||
|
<table-cell>
|
||||||
|
<a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
||||||
|
</table-cell>
|
||||||
|
</table-row>
|
||||||
|
<table-row>
|
||||||
|
<table-cell>Magic Mouse 2</table-cell>
|
||||||
|
<table-cell>Black</table-cell>
|
||||||
|
<table-cell>Accessories</table-cell>
|
||||||
|
<table-cell>$99</table-cell>
|
||||||
|
<table-cell>
|
||||||
|
<a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
||||||
|
</table-cell>
|
||||||
|
</table-row>
|
||||||
|
</table-body>
|
||||||
|
</Table>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { Table, TableHead, TableBody, TableHeadCell, TableRow, TableCell } from '../../../../src/index'
|
||||||
|
</script>
|
||||||
43
docs/components/table/examples/TableStripedExample.vue
Normal file
43
docs/components/table/examples/TableStripedExample.vue
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<template>
|
||||||
|
<Table striped>
|
||||||
|
<table-head>
|
||||||
|
<table-head-cell>Product name</table-head-cell>
|
||||||
|
<table-head-cell>Color</table-head-cell>
|
||||||
|
<table-head-cell>Category</table-head-cell>
|
||||||
|
<table-head-cell>Price</table-head-cell>
|
||||||
|
<table-head-cell><span class="sr-only">Edit</span></table-head-cell>
|
||||||
|
</table-head>
|
||||||
|
<table-body>
|
||||||
|
<table-row>
|
||||||
|
<table-cell>Apple MacBook Pro 17"</table-cell>
|
||||||
|
<table-cell>Sliver</table-cell>
|
||||||
|
<table-cell>Laptop</table-cell>
|
||||||
|
<table-cell>$2999</table-cell>
|
||||||
|
<table-cell>
|
||||||
|
<a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
||||||
|
</table-cell>
|
||||||
|
</table-row>
|
||||||
|
<table-row>
|
||||||
|
<table-cell>Microsoft Surface Pro</table-cell>
|
||||||
|
<table-cell>White</table-cell>
|
||||||
|
<table-cell>Laptop PC</table-cell>
|
||||||
|
<table-cell>$1999</table-cell>
|
||||||
|
<table-cell>
|
||||||
|
<a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
||||||
|
</table-cell>
|
||||||
|
</table-row>
|
||||||
|
<table-row>
|
||||||
|
<table-cell>Magic Mouse 2</table-cell>
|
||||||
|
<table-cell>Black</table-cell>
|
||||||
|
<table-cell>Accessories</table-cell>
|
||||||
|
<table-cell>$99</table-cell>
|
||||||
|
<table-cell>
|
||||||
|
<a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
||||||
|
</table-cell>
|
||||||
|
</table-row>
|
||||||
|
</table-body>
|
||||||
|
</Table>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { Table, TableHead, TableBody, TableHeadCell, TableRow, TableCell } from '../../../../src/index'
|
||||||
|
</script>
|
||||||
@@ -1,15 +1,167 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import TableExample from './examples/TableExample.vue'
|
import TableExample from './examples/TableExample.vue';
|
||||||
|
import TableStripedExample from './examples/TableStripedExample.vue';
|
||||||
|
import TableHoverableExample from './examples/TableHoverableExample.vue';
|
||||||
</script>
|
</script>
|
||||||
# Vue Table Component - Flowbite
|
# Vue Table Component - Flowbite
|
||||||
|
|
||||||
```vue
|
#### Button groups are a Tailwind CSS powered set of buttons sticked together in a horizontal line
|
||||||
<script setup>
|
|
||||||
import { Table } from 'flowbite-vue'
|
---
|
||||||
</script>
|
|
||||||
<template>
|
:::tip
|
||||||
<Table></Table>
|
Original reference: [https://flowbite.com/docs/components/tables/](https://flowbite.com/docs/components/tables/)
|
||||||
</template>
|
:::
|
||||||
```
|
|
||||||
|
## Basic example
|
||||||
|
|
||||||
<TableExample />
|
<TableExample />
|
||||||
|
|
||||||
|
```vue
|
||||||
|
<template>
|
||||||
|
<Table>
|
||||||
|
<table-head>
|
||||||
|
<table-head-cell>Product name</table-head-cell>
|
||||||
|
<table-head-cell>Color</table-head-cell>
|
||||||
|
<table-head-cell>Category</table-head-cell>
|
||||||
|
<table-head-cell>Price</table-head-cell>
|
||||||
|
<table-head-cell><span class="sr-only">Edit</span></table-head-cell>
|
||||||
|
</table-head>
|
||||||
|
<table-body>
|
||||||
|
<table-row>
|
||||||
|
<table-cell>Apple MacBook Pro 17"</table-cell>
|
||||||
|
<table-cell>Sliver</table-cell>
|
||||||
|
<table-cell>Laptop</table-cell>
|
||||||
|
<table-cell>$2999</table-cell>
|
||||||
|
<table-cell>
|
||||||
|
<a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
||||||
|
</table-cell>
|
||||||
|
</table-row>
|
||||||
|
<table-row>
|
||||||
|
<table-cell>Microsoft Surface Pro</table-cell>
|
||||||
|
<table-cell>White</table-cell>
|
||||||
|
<table-cell>Laptop PC</table-cell>
|
||||||
|
<table-cell>$1999</table-cell>
|
||||||
|
<table-cell>
|
||||||
|
<a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
||||||
|
</table-cell>
|
||||||
|
</table-row>
|
||||||
|
<table-row>
|
||||||
|
<table-cell>Magic Mouse 2</table-cell>
|
||||||
|
<table-cell>Black</table-cell>
|
||||||
|
<table-cell>Accessories</table-cell>
|
||||||
|
<table-cell>$99</table-cell>
|
||||||
|
<table-cell>
|
||||||
|
<a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
||||||
|
</table-cell>
|
||||||
|
</table-row>
|
||||||
|
</table-body>
|
||||||
|
</Table>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { Table, TableHead, TableBody, TableHeadCell, TableRow, TableCell } from 'flowbite-vue'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Striped example
|
||||||
|
|
||||||
|
<TableStripedExample />
|
||||||
|
|
||||||
|
```vue
|
||||||
|
<template>
|
||||||
|
<Table striped>
|
||||||
|
<table-head>
|
||||||
|
<table-head-cell>Product name</table-head-cell>
|
||||||
|
<table-head-cell>Color</table-head-cell>
|
||||||
|
<table-head-cell>Category</table-head-cell>
|
||||||
|
<table-head-cell>Price</table-head-cell>
|
||||||
|
<table-head-cell><span class="sr-only">Edit</span></table-head-cell>
|
||||||
|
</table-head>
|
||||||
|
<table-body>
|
||||||
|
<table-row>
|
||||||
|
<table-cell>Apple MacBook Pro 17"</table-cell>
|
||||||
|
<table-cell>Sliver</table-cell>
|
||||||
|
<table-cell>Laptop</table-cell>
|
||||||
|
<table-cell>$2999</table-cell>
|
||||||
|
<table-cell>
|
||||||
|
<a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
||||||
|
</table-cell>
|
||||||
|
</table-row>
|
||||||
|
<table-row>
|
||||||
|
<table-cell>Microsoft Surface Pro</table-cell>
|
||||||
|
<table-cell>White</table-cell>
|
||||||
|
<table-cell>Laptop PC</table-cell>
|
||||||
|
<table-cell>$1999</table-cell>
|
||||||
|
<table-cell>
|
||||||
|
<a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
||||||
|
</table-cell>
|
||||||
|
</table-row>
|
||||||
|
<table-row>
|
||||||
|
<table-cell>Magic Mouse 2</table-cell>
|
||||||
|
<table-cell>Black</table-cell>
|
||||||
|
<table-cell>Accessories</table-cell>
|
||||||
|
<table-cell>$99</table-cell>
|
||||||
|
<table-cell>
|
||||||
|
<a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
||||||
|
</table-cell>
|
||||||
|
</table-row>
|
||||||
|
</table-body>
|
||||||
|
</Table>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { Table, TableHead, TableBody, TableHeadCell, TableRow, TableCell } from 'flowbite-vue'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Hoverable example
|
||||||
|
|
||||||
|
<TableHoverableExample />
|
||||||
|
|
||||||
|
```vue
|
||||||
|
<template>
|
||||||
|
<Table hoverable>
|
||||||
|
<table-head>
|
||||||
|
<table-head-cell>Product name</table-head-cell>
|
||||||
|
<table-head-cell>Color</table-head-cell>
|
||||||
|
<table-head-cell>Category</table-head-cell>
|
||||||
|
<table-head-cell>Price</table-head-cell>
|
||||||
|
<table-head-cell><span class="sr-only">Edit</span></table-head-cell>
|
||||||
|
</table-head>
|
||||||
|
<table-body>
|
||||||
|
<table-row>
|
||||||
|
<table-cell>Apple MacBook Pro 17"</table-cell>
|
||||||
|
<table-cell>Sliver</table-cell>
|
||||||
|
<table-cell>Laptop</table-cell>
|
||||||
|
<table-cell>$2999</table-cell>
|
||||||
|
<table-cell>
|
||||||
|
<a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
||||||
|
</table-cell>
|
||||||
|
</table-row>
|
||||||
|
<table-row>
|
||||||
|
<table-cell>Microsoft Surface Pro</table-cell>
|
||||||
|
<table-cell>White</table-cell>
|
||||||
|
<table-cell>Laptop PC</table-cell>
|
||||||
|
<table-cell>$1999</table-cell>
|
||||||
|
<table-cell>
|
||||||
|
<a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
||||||
|
</table-cell>
|
||||||
|
</table-row>
|
||||||
|
<table-row>
|
||||||
|
<table-cell>Magic Mouse 2</table-cell>
|
||||||
|
<table-cell>Black</table-cell>
|
||||||
|
<table-cell>Accessories</table-cell>
|
||||||
|
<table-cell>$99</table-cell>
|
||||||
|
<table-cell>
|
||||||
|
<a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a>
|
||||||
|
</table-cell>
|
||||||
|
</table-row>
|
||||||
|
</table-body>
|
||||||
|
</Table>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { Table, TableHead, TableBody, TableHeadCell, TableRow, TableCell } from 'flowbite-vue'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg">
|
<div class="vp-raw relative overflow-x-auto shadow-md sm:rounded-lg">
|
||||||
<table class="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
<table class="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
|
||||||
import { useTableRowClasses } from '@/components/Table/composables/tableRowClasses'
|
import { useTableRowClasses } from '@/components/Table/composables/tableRowClasses'
|
||||||
|
|
||||||
const { tableRowClasses } = useTableRowClasses()
|
const { tableRowClasses } = useTableRowClasses()
|
||||||
|
|||||||
Reference in New Issue
Block a user