From dffd5196cb22bd04633199acd1b17f1ee912e262 Mon Sep 17 00:00:00 2001 From: shutao Date: Thu, 16 Nov 2023 19:23:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4scroll-view=E7=A4=BA=E4=BE=8B?= =?UTF-8?q?=20=E5=A2=9E=E5=8A=A0scroll-x=E3=80=81scroll-y=E5=9D=87?= =?UTF-8?q?=E4=B8=BAfalse=E7=9A=84=E5=9C=BA=E6=99=AF=20=E5=8F=AF=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E8=A7=A6=E5=8F=91touchmove=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scroll-view/scroll-view-props.uvue | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/pages/component/scroll-view/scroll-view-props.uvue b/pages/component/scroll-view/scroll-view-props.uvue index 0b721f4d..aa1140f2 100644 --- a/pages/component/scroll-view/scroll-view-props.uvue +++ b/pages/component/scroll-view/scroll-view-props.uvue @@ -12,10 +12,11 @@ {{item.label}} - {{item.label}} @@ -38,7 +39,11 @@ 是否横向滚动 - + + + + 是否竖向滚动 + @@ -86,7 +91,8 @@ data() { return { items: [] as Item[], - scrollX: false, + scrollX: false, + scrollY: true, rebound: false, scrollTop: 0, scrollLeft: 0, @@ -115,10 +121,21 @@ handleChangeScrollTop(e : SliderChangeEvent) { this.scrollTop = e.detail.value; }, - changeDirection() { - this.scrollX = !this.scrollX; + changeDirectionX() { + this.scrollX = !this.scrollX; + if(this.scrollX) { + this.scrollY = false + } this.scrollTop = 0; this.scrollLeft = 0; + }, + changeDirectionY() { + this.scrollY = !this.scrollY; + if(this.scrollY) { + this.scrollX = false + } + this.scrollTop = 0; + this.scrollLeft = 0; }, handleScrollIntoView() { if (this.scrollX) { @@ -160,6 +177,9 @@ scrollend() { console.log("滚动停止"); }, + onTouchMove() { + console.log("TouchMove"); + }, //自动化测试专用 checkScrollHeight(): Boolean { var element = this.$refs["scrollViewY"] -- GitLab