Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 4ba261a

Browse files
authored
Merge pull request #316 from emielbeinema/lazy-load-tab
Add lazy-load property to `TabContent`
2 parents cfc12ce + ee0fc95 commit 4ba261a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

docs/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,13 @@ props: {
141141
type: String,
142142
default: ''
143143
},
144+
/***
145+
* Only render the content when the tab is active
146+
*/
147+
lazy: {
148+
type: Boolean,
149+
default: false
150+
},
144151
/***
145152
* Function to execute before tab switch. Return value must be boolean
146153
* If the return result is false, tab switch is restricted

src/components/TabContent.vue

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div v-show="active" class="wizard-tab-container"
2+
<div v-show="active" v-if="!lazy || active" class="wizard-tab-container"
33
role="tabpanel"
44
:id="tabId"
55
:aria-hidden="!active"
@@ -23,6 +23,13 @@
2323
type: String,
2424
default: ''
2525
},
26+
/***
27+
* Only render the content when the tab is active
28+
*/
29+
lazy: {
30+
type: Boolean,
31+
default: false
32+
},
2633
/***
2734
* Function to execute before tab switch. Return value must be boolean
2835
* If the return result is false, tab switch is restricted

0 commit comments

Comments
 (0)