feat(Tabs): add content prop to avoid the render of the HTML markup (#1831)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Vitta
2024-06-04 10:23:17 +02:00
committed by GitHub
parent 831c560a96
commit 6e2678d1d8
2 changed files with 7 additions and 1 deletions

View File

@@ -63,6 +63,8 @@ componentProps:
---
::
You can use the `content` prop and set it to `false` to avoid the rendering of the HTML content if you don't need it.
### Control the selected index
Use a `v-model` to control the selected index.

View File

@@ -32,7 +32,7 @@
</HTab>
</HTabList>
<HTabPanels :class="ui.container">
<HTabPanels v-if="content" :class="ui.container">
<HTabPanel v-for="(item, index) of items" :key="index" v-slot="{ selected }" :class="ui.base" :unmount="unmount">
<slot :name="item.slot || 'item'" :item="item" :index="index" :selected="selected">
{{ item.content }}
@@ -88,6 +88,10 @@ export default defineComponent({
type: Boolean,
default: false
},
content: {
type: Boolean,
default: true
},
class: {
type: [String, Object, Array] as PropType<any>,
default: () => ''