Skip to content

Commit

Permalink
feat(docs): add docs for empty slot
Browse files Browse the repository at this point in the history
  • Loading branch information
Haythamasalama committed Jun 7, 2023
1 parent 06f15fa commit 1184cb1
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
29 changes: 29 additions & 0 deletions docs/components/content/examples/TableExampleEmptySlot.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<script setup>
const columns = [{
key: 'name',
label: 'Name'
}, {
key: 'title',
label: 'Title'
}, {
key: 'email',
label: 'Email'
}, {
key: 'role',
label: 'Role'
}, {
key: 'actions'
}]
const people = []
</script>

<template>
<UTable :rows="people" :columns="columns">
<template #empty-state>
<div class="flex items-center justify-center">
<span class="py-10">No Data.</span>
</div>
</template>
</UTable>
</template>
31 changes: 31 additions & 0 deletions docs/content/4.data/1.table.md
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,37 @@ const selected = ref([people[1]])
```
::

### `empty-state`

Use the `#empty-state` slot to customize the empty state.

::component-example{class="grid"}
---
padding: false
overflowClass: 'overflow-x-auto'
---

#default
:table-example-empty-slot{class="flex-1"}

#code
```vue
<script setup>
const columns = [...]
const people = [...]
</script>
<template>
<UTable :rows="people" :columns="columns">
<template #empty-state>
<div class="flex items-center justify-center">
<span class="py-10">No Data.</span>
</div>
</template>
</UTable>
</template>
```
::

## Props

:component-props
Expand Down

0 comments on commit 1184cb1

Please sign in to comment.