feat(Tab): improve scrollLeftTo performance
This commit is contained in:
+1
-1
@@ -205,7 +205,7 @@ In scrollspy mode, the list of content will be tiled
|
||||
| sticky | Whether to use sticky mode | *boolean* | `false` | - |
|
||||
| swipeable | Whether to switch tabs with swipe gestrue in the content | *boolean* | `false` | - |
|
||||
| lazy-render | Whether to enable tab content lazy render | *boolean* | `true` | - |
|
||||
| scrollspy | Whether to use scrollspy mode | *boolean* | `false` | - |
|
||||
| scrollspy | Whether to use scrollspy mode | *boolean* | `false` | 2.3.0 |
|
||||
|
||||
### Tab Props
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ export default {
|
||||
| sticky | 是否使用粘性定位布局 | *boolean* | `false` | - |
|
||||
| swipeable | 是否开启手势滑动切换 | *boolean* | `false` | - |
|
||||
| lazy-render | 是否开启标签页内容延迟渲染 | *boolean* | `true` | - |
|
||||
| scrollspy | 是否开启滚动导航 | *boolean* | `false` | - |
|
||||
| scrollspy | 是否开启滚动导航 | *boolean* | `false` | 2.3.0 |
|
||||
|
||||
### Tab Props
|
||||
|
||||
|
||||
+4
-4
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user