From 7f76d6724a7e214825ff4a9ffdf2ee8ecb4fb9fe Mon Sep 17 00:00:00 2001 From: windyeasy Date: Fri, 4 Oct 2024 14:50:20 +0800 Subject: [PATCH 1/5] feat: add showScrollbar for the wd-tabs --- .../wot-design-uni/components/wd-tabs/types.ts | 8 +++++++- .../wot-design-uni/components/wd-tabs/wd-tabs.vue | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/uni_modules/wot-design-uni/components/wd-tabs/types.ts b/src/uni_modules/wot-design-uni/components/wd-tabs/types.ts index 959ba13b0..540c85b33 100644 --- a/src/uni_modules/wot-design-uni/components/wd-tabs/types.ts +++ b/src/uni_modules/wot-design-uni/components/wd-tabs/types.ts @@ -58,7 +58,13 @@ export const tabsProps = { /** * 切换动画过渡时间,单位毫秒 */ - duration: makeNumberProp(300) + duration: makeNumberProp(300), + /** + * 控制是否出现滚动条 + * + * 默认为 false + */ + showScrollbar: makeBooleanProp(false) } export type TabsProps = ExtractPropTypes diff --git a/src/uni_modules/wot-design-uni/components/wd-tabs/wd-tabs.vue b/src/uni_modules/wot-design-uni/components/wd-tabs/wd-tabs.vue index 389f73a8b..ee625816f 100644 --- a/src/uni_modules/wot-design-uni/components/wd-tabs/wd-tabs.vue +++ b/src/uni_modules/wot-design-uni/components/wd-tabs/wd-tabs.vue @@ -80,7 +80,7 @@ - + Date: Fri, 4 Oct 2024 14:52:22 +0800 Subject: [PATCH 2/5] =?UTF-8?q?docs:=20tabs=E6=B7=BB=E5=8A=A0showScrollbar?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/component/tabs.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/component/tabs.md b/docs/component/tabs.md index 4feef4602..a83f992cd 100644 --- a/docs/component/tabs.md +++ b/docs/component/tabs.md @@ -147,6 +147,7 @@ const tab = ref('例子') | inactiveColor | 非活动标签文字颜色 | string | - | - | - | | animated | 是否开启切换标签内容时的转场动画 | boolean | - | false | - | | duration | 切换动画过渡时间,单位毫秒 | number | - | 300 | - | +| showScrollbar | 当标签可以滑动时是否显示滚动条 | boolean | - | false | - | ## Tab Attributes From 8d33269958538e5e1ae3b44c51271aaf694b979b Mon Sep 17 00:00:00 2001 From: windyeasy Date: Fri, 4 Oct 2024 15:02:45 +0800 Subject: [PATCH 3/5] =?UTF-8?q?docs:=20=E2=9C=8F=EF=B8=8F=20=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=9C=80=E4=BD=8E=E7=89=88=E6=9C=AC=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tabs组件添加showScrollbar属性控制标签可滑动时是否显示滚动条 --- docs/component/tabs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/component/tabs.md b/docs/component/tabs.md index a83f992cd..b7289cb20 100644 --- a/docs/component/tabs.md +++ b/docs/component/tabs.md @@ -147,7 +147,7 @@ const tab = ref('例子') | inactiveColor | 非活动标签文字颜色 | string | - | - | - | | animated | 是否开启切换标签内容时的转场动画 | boolean | - | false | - | | duration | 切换动画过渡时间,单位毫秒 | number | - | 300 | - | -| showScrollbar | 当标签可以滑动时是否显示滚动条 | boolean | - | false | - | +| showScrollbar | 当标签可以滑动时是否显示滚动条 | boolean | - | false | $LOWEST_VERSION$ | ## Tab Attributes From 5bbf24f5dc7e74883e2690dc6e2c348729f30e3c Mon Sep 17 00:00:00 2001 From: windyeasy Date: Wed, 16 Oct 2024 08:57:05 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix:=20=E4=BD=BF=E7=94=A8css=E6=8E=A7?= =?UTF-8?q?=E5=88=B6tabs=E7=9A=84scrollbar=E6=98=BE=E7=A4=BA=E4=B8=8E?= =?UTF-8?q?=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wot-design-uni/components/wd-tabs/index.scss | 8 +++++++- .../wot-design-uni/components/wd-tabs/types.ts | 2 +- .../wot-design-uni/components/wd-tabs/wd-tabs.vue | 15 ++++++++++++--- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/uni_modules/wot-design-uni/components/wd-tabs/index.scss b/src/uni_modules/wot-design-uni/components/wd-tabs/index.scss index 3325b3920..bcc636fe1 100644 --- a/src/uni_modules/wot-design-uni/components/wd-tabs/index.scss +++ b/src/uni_modules/wot-design-uni/components/wd-tabs/index.scss @@ -278,4 +278,10 @@ .wd-tabs__map-nav-btn { width: 90px; } -} \ No newline at end of file +} + +.hide-scrollbar::-webkit-scrollbar, .hide-scrollbar ::-webkit-scrollbar { + width: 0; + height: 0; + -webkit-appearance: none; +} diff --git a/src/uni_modules/wot-design-uni/components/wd-tabs/types.ts b/src/uni_modules/wot-design-uni/components/wd-tabs/types.ts index 540c85b33..5b2b79f01 100644 --- a/src/uni_modules/wot-design-uni/components/wd-tabs/types.ts +++ b/src/uni_modules/wot-design-uni/components/wd-tabs/types.ts @@ -64,7 +64,7 @@ export const tabsProps = { * * 默认为 false */ - showScrollbar: makeBooleanProp(false) + showScrollbar: makeBooleanProp(true) } export type TabsProps = ExtractPropTypes diff --git a/src/uni_modules/wot-design-uni/components/wd-tabs/wd-tabs.vue b/src/uni_modules/wot-design-uni/components/wd-tabs/wd-tabs.vue index ee625816f..acab18db8 100644 --- a/src/uni_modules/wot-design-uni/components/wd-tabs/wd-tabs.vue +++ b/src/uni_modules/wot-design-uni/components/wd-tabs/wd-tabs.vue @@ -2,7 +2,11 @@