mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-28 10:50:40 +01:00
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:
@@ -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
|
### Control the selected index
|
||||||
|
|
||||||
Use a `v-model` to control the selected index.
|
Use a `v-model` to control the selected index.
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
</HTab>
|
</HTab>
|
||||||
</HTabList>
|
</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">
|
<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">
|
<slot :name="item.slot || 'item'" :item="item" :index="index" :selected="selected">
|
||||||
{{ item.content }}
|
{{ item.content }}
|
||||||
@@ -88,6 +88,10 @@ export default defineComponent({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
|
content: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
class: {
|
class: {
|
||||||
type: [String, Object, Array] as PropType<any>,
|
type: [String, Object, Array] as PropType<any>,
|
||||||
default: () => ''
|
default: () => ''
|
||||||
|
|||||||
Reference in New Issue
Block a user