From a6d01ca9b667c338ed8fafceb1feee0c7254c919 Mon Sep 17 00:00:00 2001 From: zcl <2810534555@qq.com> Date: Thu, 12 Dec 2024 13:15:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20tabs=E5=BA=95=E9=83=A8=E6=9D=A1?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E6=94=AF=E6=8C=81=E8=87=AA=E7=94=B1=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/component/tabs.md | 1 + src/uni_modules/wot-design-uni/components/wd-tabs/types.ts | 4 ++++ .../wot-design-uni/components/wd-tabs/wd-tabs.vue | 5 ++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/component/tabs.md b/docs/component/tabs.md index ef2a37194..e40f0b3bf 100644 --- a/docs/component/tabs.md +++ b/docs/component/tabs.md @@ -263,6 +263,7 @@ function handlePopupShow() { | autoLineWidth | 底部条宽度跟随文字,指定`lineWidth`时此选项不生效 | boolean | - | false | 1.4.0 | | lineWidth | 底部条宽度,单位像素 | number | - | 19 | - | | lineHeight | 底部条高度,单位像素 | number | - | 3 | - | +| lineBgGolor | 底部条颜色 | string | - | #4d80f0 | $LOWEST_VERSION$ | | color | 文字颜色 | string | - | - | - | | inactiveColor | 非活动标签文字颜色 | string | - | - | - | | animated | 是否开启切换标签内容时的转场动画 | boolean | - | false | - | 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 7d4f1448d..87ef927b7 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 @@ -59,6 +59,10 @@ export const tabsProps = { * 底部条高度,单位像素 */ lineHeight: numericProp, + /** + * 底部条颜色 + */ + lineBgGolor: makeStringProp(''), /** * 颜色 */ 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 80cf1d13d..fee8239f9 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 @@ -308,7 +308,7 @@ function toggleMap() { */ async function updateLineStyle(animation: boolean = true) { if (!state.inited) return - const { autoLineWidth, lineWidth, lineHeight } = props + const { autoLineWidth, lineWidth, lineHeight, lineBgGolor } = props try { const lineStyle: CSSProperties = {} if (isDef(lineWidth)) { @@ -320,6 +320,9 @@ async function updateLineStyle(animation: boolean = true) { lineStyle.width = addUnit(textWidth) } } + if (isDef(lineBgGolor)) { + lineStyle.background = addUnit(lineBgGolor) + } if (isDef(lineHeight)) { lineStyle.height = addUnit(lineHeight) lineStyle.borderRadius = `calc(${addUnit(lineHeight)} / 2)` From 04486a3a37524be3351574505048cc0e8f5a8595 Mon Sep 17 00:00:00 2001 From: zcl <2810534555@qq.com> Date: Thu, 12 Dec 2024 14:01:21 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20tabs=E5=BA=95=E9=83=A8=E6=9D=A1?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E6=94=AF=E6=8C=81=E8=87=AA=E7=94=B1=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/component/tabs.md | 2 +- src/uni_modules/wot-design-uni/components/wd-tabs/types.ts | 2 +- .../wot-design-uni/components/wd-tabs/wd-tabs.vue | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/component/tabs.md b/docs/component/tabs.md index e40f0b3bf..f9aab7813 100644 --- a/docs/component/tabs.md +++ b/docs/component/tabs.md @@ -263,7 +263,7 @@ function handlePopupShow() { | autoLineWidth | 底部条宽度跟随文字,指定`lineWidth`时此选项不生效 | boolean | - | false | 1.4.0 | | lineWidth | 底部条宽度,单位像素 | number | - | 19 | - | | lineHeight | 底部条高度,单位像素 | number | - | 3 | - | -| lineBgGolor | 底部条颜色 | string | - | #4d80f0 | $LOWEST_VERSION$ | +| lineBgColor | 底部条颜色 | string | - | #4d80f0 | $LOWEST_VERSION$ | | color | 文字颜色 | string | - | - | - | | inactiveColor | 非活动标签文字颜色 | string | - | - | - | | animated | 是否开启切换标签内容时的转场动画 | boolean | - | false | - | 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 87ef927b7..2e18a4ad6 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 @@ -62,7 +62,7 @@ export const tabsProps = { /** * 底部条颜色 */ - lineBgGolor: makeStringProp(''), + lineBgColor: makeStringProp(''), /** * 颜色 */ 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 fee8239f9..d7cfbe025 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 @@ -308,7 +308,7 @@ function toggleMap() { */ async function updateLineStyle(animation: boolean = true) { if (!state.inited) return - const { autoLineWidth, lineWidth, lineHeight, lineBgGolor } = props + const { autoLineWidth, lineWidth, lineHeight, lineBgColor } = props try { const lineStyle: CSSProperties = {} if (isDef(lineWidth)) { @@ -320,8 +320,8 @@ async function updateLineStyle(animation: boolean = true) { lineStyle.width = addUnit(textWidth) } } - if (isDef(lineBgGolor)) { - lineStyle.background = addUnit(lineBgGolor) + if (isDef(lineBgColor)) { + lineStyle.background = addUnit(lineBgColor) } if (isDef(lineHeight)) { lineStyle.height = addUnit(lineHeight)