feat(Tab): add scrollspy prop (#5273)

This commit is contained in:
健忘症患者丶
2019-12-16 20:17:09 +08:00
committed by neverland
parent 9cd06f3b20
commit 4603e1633c
12 changed files with 266 additions and 10 deletions

View File

@@ -46,7 +46,8 @@ export default createComponent({
render(h) {
const { slots, isActive } = this;
const shouldRender = this.inited || !this.parent.lazyRender;
const shouldRender = this.inited || this.parent.scrollspy || !this.parent.lazyRender;
const show = this.parent.scrollspy || isActive;
const Content = shouldRender ? slots() : h();
if (this.parent.animated) {
@@ -62,7 +63,7 @@ export default createComponent({
}
return (
<div vShow={isActive} role="tabpanel" class={bem('pane')}>
<div vShow={show} role="tabpanel" class={bem('pane')}>
{Content}
</div>
);