From f00b2ec210f65b386a57e96419251266a156a8b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9A=E9=A3=8E?= Date: Mon, 16 May 2022 13:17:17 +0800 Subject: [PATCH 1/2] fix: codepen vue version --- examples/docs/en-US/installation.md | 8 ++++---- examples/docs/es/installation.md | 8 ++++---- examples/docs/fr-FR/installation.md | 8 ++++---- examples/docs/zh-CN/installation.md | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/examples/docs/en-US/installation.md b/examples/docs/en-US/installation.md index 9ea096d60c..0a9ad67b01 100644 --- a/examples/docs/en-US/installation.md +++ b/examples/docs/en-US/installation.md @@ -25,11 +25,11 @@ We recommend our users to lock Element's version when using CDN. Please refer to ### Hello world -If you are using CDN, a hello-world page is easy with Element. [Online Demo](https://codepen.io/ziyoung/pen/rRKYpd) +If you are using CDN, a hello-world page is easy with Element. [Online Demo](https://codepen.io/bofeng/pen/poaEmJY) - If you are using npm and wish to apply webpack, please continue to the next page: [Quick Start](/#/en-US/component/quickstart). diff --git a/examples/docs/es/installation.md b/examples/docs/es/installation.md index 1a252aa62c..bee46f46a0 100644 --- a/examples/docs/es/installation.md +++ b/examples/docs/es/installation.md @@ -24,11 +24,11 @@ Recomendamos a nuestros usuarios congelar la versión de Element cuando usas un ### Hello world -Si esta usando un CDN, una página con Hello-World es fácil con Element. [Online Demo](https://codepen.io/ziyoung/pen/rRKYpd) +Si esta usando un CDN, una página con Hello-World es fácil con Element. [Online Demo](https://codepen.io/bofeng/pen/poaEmJY) - Si esta usando npm y desea combinarlo con webpack, por favor continué a la siguiente página: [Quick Start](/#/es/component/quickstart) diff --git a/examples/docs/fr-FR/installation.md b/examples/docs/fr-FR/installation.md index fd39b3cc98..0581308ca2 100644 --- a/examples/docs/fr-FR/installation.md +++ b/examples/docs/fr-FR/installation.md @@ -25,11 +25,11 @@ Il est recommandé de fixer la version d'Element lors de l'utilisation du CDN. R ### Hello world -Si vous utilisez un CDN, une page hello-world peut être obtenue facilement avec Element ([démo en ligne](https://codepen.io/ziyoung/pen/rRKYpd)). +Si vous utilisez un CDN, une page hello-world peut être obtenue facilement avec Element ([démo en ligne](https://codepen.io/bofeng/pen/poaEmJY)). - Si vous utilisez npm et souhaitez ajouter webpack, continuez sur la page suivante: [Démarrer](/#/fr-FR/component/quickstart). diff --git a/examples/docs/zh-CN/installation.md b/examples/docs/zh-CN/installation.md index 62ccdff21d..7665033d95 100644 --- a/examples/docs/zh-CN/installation.md +++ b/examples/docs/zh-CN/installation.md @@ -25,11 +25,11 @@ npm i element-ui -S ### Hello world -通过 CDN 的方式我们可以很容易地使用 Element 写出一个 Hello world 页面。[在线演示](https://codepen.io/ziyoung/pen/rRKYpd) +通过 CDN 的方式我们可以很容易地使用 Element 写出一个 Hello world 页面。[在线演示](https://codepen.io/bofeng/pen/poaEmJY) - 如果是通过 npm 安装,并希望配合 webpack 使用,请阅读下一节:[快速上手](/#/zh-CN/component/quickstart)。 From b086393e73d266becca02d8a5fa11c2d25845848 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9A=E9=A3=8E?= Date: Thu, 26 May 2022 16:57:43 +0800 Subject: [PATCH 2/2] fix table-header sync --- packages/table/src/table.vue | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/packages/table/src/table.vue b/packages/table/src/table.vue index e0061e6282..2fa3c93add 100644 --- a/packages/table/src/table.vue +++ b/packages/table/src/table.vue @@ -412,7 +412,7 @@ }, // TODO 使用 CSS transform - syncPostion: throttle(20, function() { + syncPostion() { const { scrollLeft, scrollTop, offsetWidth, scrollWidth } = this.bodyWrapper; const { headerWrapper, footerWrapper, fixedBodyWrapper, rightFixedBodyWrapper } = this.$refs; if (headerWrapper) headerWrapper.scrollLeft = scrollLeft; @@ -427,17 +427,30 @@ } else { this.scrollPosition = 'middle'; } + }, + + throttleSyncPostion: throttle(16, function() { + this.syncPostion(); }), + onScroll(evt) { + let raf = window.requestAnimationFrame; + if (!raf) { + this.throttleSyncPostion(); + } else { + raf(this.syncPostion); + } + }, + bindEvents() { - this.bodyWrapper.addEventListener('scroll', this.syncPostion, { passive: true }); + this.bodyWrapper.addEventListener('scroll', this.onScroll, { passive: true }); if (this.fit) { addResizeListener(this.$el, this.resizeListener); } }, unbindEvents() { - this.bodyWrapper.removeEventListener('scroll', this.syncPostion, { passive: true }); + this.bodyWrapper.removeEventListener('scroll', this.onScroll, { passive: true }); if (this.fit) { removeResizeListener(this.$el, this.resizeListener); }