docs(tabs): update

This commit is contained in:
Benjamin Canac
2024-07-22 16:32:06 +02:00
parent d6950d3df8
commit ec0f599565
4 changed files with 173 additions and 17 deletions

View File

@@ -30,15 +30,12 @@ hide:
props:
class: 'w-full'
items:
- label: Tab 1
icon: 'i-heroicons-academic-cap'
content: 'Content 1'
- label: Tab 2
- label: Account
icon: 'i-heroicons-user'
content: 'Content 2'
- label: Tab 3
icon: 'i-heroicons-bell'
content: 'Content 3'
content: 'This is the account content.'
- label: Password
icon: 'i-heroicons-lock-closed'
content: 'This is the password content.'
---
::
@@ -65,9 +62,8 @@ props:
class: 'w-full'
content: false
items:
- label: Tab 1
- label: Tab 2
- label: Tab 3
- label: Account
- label: Password
---
::
@@ -86,12 +82,12 @@ hide:
- class
props:
size: md
variant: pill
class: 'w-full'
content: false
items:
- label: Tab 1
- label: Tab 2
- label: Tab 3
- label: Account
- label: Password
---
::
@@ -114,14 +110,73 @@ props:
class: 'w-full'
content: false
items:
- label: Tab 1
- label: Tab 2
- label: Tab 3
- label: Account
- label: Password
---
::
### Default value
Use the `default-value` prop to set the default value of the Tabs with the index of the item. You can also pass the value of one of the items if provided.
::component-code
---
ignore:
- items
- content
- defaultValue
external:
- items
hide:
- class
props:
defaultValue: '1'
class: 'w-full'
content: false
items:
- label: Account
- label: Password
---
::
### Model value
You can control the selected tab by using the `v-model` directive.
::component-example
---
name: 'tabs-model-value-example'
props:
class: 'w-full'
---
::
## Examples
### With content slot
Use the `#content` slot to customize each item.
::component-example
---
name: 'tabs-content-slot-example'
props:
class: 'w-full'
---
::
### With custom slot
Use the `slot` property to customize a specific item with a form for example.
::component-example
---
name: 'tabs-custom-slot-example'
props:
class: 'w-full'
---
::
## API
### Props