File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -380,6 +380,46 @@ need to accommodate your custom classes for this._
380380<!-- b-tabs-with-classes.vue -->
381381```
382382
383+ ## Lazy loading tab content
384+
385+ Sometimes it's preferred to load components & data only when activating a tab, instead of loading
386+ all tabs (and associated data) when rendering the ` <b-tabs> ` set.
387+
388+ Individual ` <b-tab> ` components can be lazy loaded via the ` lazy ` prop, which when set doesn't mount
389+ the content of the ` <b-tab> ` until it is activated (shown), and will be un-mounted when the tab is
390+ deactivated (hidden):
391+
392+ ``` html
393+ <b-tabs >
394+ <b-tab title =" abc" >
395+ <!-- this content will always be mounted -->
396+ <div >Tab ABC content</div >
397+ </b-tab >
398+ <b-tab title =" xyz" lazy >
399+ <!-- this content will not be mounted until this tab is shown -->
400+ <!-- and will be un-mounted when hidden -->
401+ <my-xyz-component ></my-xyz-component >
402+ </b-tab >
403+ </b-tabs >
404+ ```
405+
406+ One can also make all tab's lazy by setting the ` lazy ` prop on the parent ` <b-tabs> ` component:
407+
408+ ``` html
409+ <b-tabs lazy >
410+ <b-tab title =" abc" >
411+ <!-- this content will not be mounted until this tab is shown -->
412+ <!-- and will be un-mounted when hidden -->
413+ <div >Tab ABC content</div >
414+ </b-tab >
415+ <b-tab title =" xyz" >
416+ <!-- this content will not be mounted until this tab is shown -->
417+ <!-- and will be un-mounted when hidden -->
418+ <my-xyz-component ></my-xyz-component >
419+ </b-tab >
420+ </b-tabs >
421+ ```
422+
383423## Keyboard navigation
384424
385425Keyboard navigation is enabled by default for ARIA compliance with tablists when a tab button has
You can’t perform that action at this time.
0 commit comments