From 0b735ac6393269277979a933f5a3562940369ea5 Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 16 Jul 2018 20:58:03 +0800 Subject: [PATCH] [bugfix] Tab: sticky in scroll element (#1496) --- packages/tabs/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/tabs/index.vue b/packages/tabs/index.vue index 2ac2cce03..6cbea44db 100644 --- a/packages/tabs/index.vue +++ b/packages/tabs/index.vue @@ -107,7 +107,7 @@ export default create({ // scroll to correct position if (this.position === 'page-top' || this.position === 'content-bottom') { - scrollUtils.setScrollTop(this.scrollEl, scrollUtils.getElementTop(this.$el)); + scrollUtils.setScrollTop(window, scrollUtils.getElementTop(this.$el)); } }, @@ -196,7 +196,7 @@ export default create({ // adjust tab position onScroll() { - const scrollTop = scrollUtils.getScrollTop(this.scrollEl); + const scrollTop = scrollUtils.getScrollTop(window); const elTopToPageTop = scrollUtils.getElementTop(this.$el); const elBottomToPageTop = elTopToPageTop + this.$el.offsetHeight - this.$refs.wrap.offsetHeight; if (scrollTop > elBottomToPageTop) {