-
Notifications
You must be signed in to change notification settings - Fork 593
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(table): add slot for empty state (#260)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
- Loading branch information
1 parent
4e5e614
commit f7a34c8
Showing
3 changed files
with
71 additions
and
6 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
docs/components/content/examples/TableExampleEmptySlot.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<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 flex-col items-center justify-center py-6 gap-3"> | ||
<span class="italic text-sm">No one here!</span> | ||
<UButton label="Add people" /> | ||
</div> | ||
</template> | ||
</UTable> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f7a34c8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
ui – ./
ui-git-dev-nuxtlabs.vercel.app
ui-nuxtlabs.vercel.app
ui.nuxtlabs.com