perf(Tab): skip rendering empty pane (#7238)

This commit is contained in:
neverland
2020-09-23 18:00:26 +08:00
committed by GitHub
parent 17099d3ac1
commit 68d47fe16a
3 changed files with 37 additions and 2 deletions
+8 -2
View File
@@ -55,9 +55,15 @@ export default createComponent({
render(h) {
const { slots, parent, isActive } = this;
const shouldRender = this.inited || parent.scrollspy || !parent.lazyRender;
const slotContent = slots();
if (!slotContent) {
return;
}
const show = parent.scrollspy || isActive;
const Content = shouldRender ? slots() : h();
const shouldRender = this.inited || parent.scrollspy || !parent.lazyRender;
const Content = shouldRender ? slotContent : h();
if (parent.animated) {
return (