[new feature] Tabs: add lazy-render props (#2800)

This commit is contained in:
neverland
2019-02-19 19:39:09 +08:00
committed by GitHub
parent 98e7d23eef
commit bff9c9d6d9
4 changed files with 68 additions and 2 deletions

View File

@@ -58,9 +58,11 @@ export default sfc({
render(h) {
const { slots } = this;
const shouldRender = this.inited || !this.parent.lazyRender;
return (
<div vShow={this.selected || this.parent.animated} class={bem('pane')}>
{this.inited ? slots() : h()}
{shouldRender ? slots() : h()}
{slots('title') && <div ref="title">{slots('title')}</div>}
</div>
);