feat(Tab): improve scrollLeftTo performance

This commit is contained in:
陈嘉涵
2019-12-16 20:57:13 +08:00
parent e9369acf26
commit f8a3669f2d
5 changed files with 35 additions and 28 deletions

View File

@@ -45,12 +45,12 @@ export default createComponent({
},
render(h) {
const { slots, isActive } = this;
const shouldRender = this.inited || this.parent.scrollspy || !this.parent.lazyRender;
const show = this.parent.scrollspy || isActive;
const { slots, parent, isActive } = this;
const shouldRender = this.inited || parent.scrollspy || !parent.lazyRender;
const show = parent.scrollspy || isActive;
const Content = shouldRender ? slots() : h();
if (this.parent.animated) {
if (parent.animated) {
return (
<div
role="tabpanel"