使用 tabs 和 tabs-item 组件在您的内容中显示选项卡。
::callout
Lorem velit voluptate ex reprehenderit ullamco et culpa.
::
::tabs
:::tabs-item{label="Code" icon="i-lucide-code"}
```mdc
::callout
Lorem velit voluptate ex reprehenderit ullamco et culpa.
::
```
:::
:::tabs-item{label="Preview" icon="i-lucide-eye"}
::callout
Lorem velit voluptate ex reprehenderit ullamco et culpa.
::
:::
::
| 属性 | 默认值 | 类型 |
|---|---|---|
defaultValue |
|
默认选中的选项卡。 |
同步 |
将选定的选项卡与本地存储键同步。 | |
哈希 |
选中选项卡时滚动到的哈希值。 | |
modelValue |
| |
ui |
|
| 插槽 | 类型 |
|---|---|
default |
|
export default defineAppConfig({
ui: {
prose: {
tabs: {
slots: {
root: 'my-5 gap-4'
}
},
tabsItem: {
base: '*:first:mt-0 *:last:mb-0 *:my-1.5'
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
ui: {
prose: {
tabs: {
slots: {
root: 'my-5 gap-4'
}
},
tabsItem: {
base: '*:first:mt-0 *:last:mb-0 *:my-1.5'
}
}
}
})
]
})