From f95e76f24d9821cc573c900cd4f664df6289ed9c Mon Sep 17 00:00:00 2001 From: "Y." Date: Fri, 3 Jan 2025 18:43:16 +0800 Subject: [PATCH] fix(Tabs): fix the badge activation color error (#3429) * fix(Tabs): fix the badge activation color error * test: update snapshots --- .../__test__/__snapshots__/demo.test.js.snap | 2 +- .../__virtualHostSnapshot__/demo.test.js.snap | 2 +- .../_example/base/index.wxml | 2 +- .../_example/base/index.wxss | 2 +- .../__test__/__snapshots__/demo.test.js.snap | 84 +------------------ src/tabs/_example/size/index.wxss | 2 +- src/tabs/_example/theme/index.wxml | 12 --- src/tabs/_example/with-content/index.wxml | 4 +- src/tabs/_example/with-content/index.wxss | 3 + src/tabs/tabs.less | 10 +++ src/tabs/tabs.wxml | 5 +- 11 files changed, 24 insertions(+), 104 deletions(-) diff --git a/src/pull-down-refresh/__test__/__snapshots__/demo.test.js.snap b/src/pull-down-refresh/__test__/__snapshots__/demo.test.js.snap index b5d44fabb..6aed389ef 100644 --- a/src/pull-down-refresh/__test__/__snapshots__/demo.test.js.snap +++ b/src/pull-down-refresh/__test__/__snapshots__/demo.test.js.snap @@ -25,7 +25,7 @@ exports[`PullDownRefresh PullDownRefresh base demo works fine 1`] = ` title="PullDownRefresh 下拉刷新" /> - + diff --git a/src/pull-down-refresh/_example/base/index.wxss b/src/pull-down-refresh/_example/base/index.wxss index 47c915f23..cf802dd53 100644 --- a/src/pull-down-refresh/_example/base/index.wxss +++ b/src/pull-down-refresh/_example/base/index.wxss @@ -18,7 +18,7 @@ line-height: 44rpx; } -.pulldown-reflesh__content { +.pulldown-refresh__content { margin: 64rpx 32rpx 0; position: relative; } diff --git a/src/tabs/__test__/__snapshots__/demo.test.js.snap b/src/tabs/__test__/__snapshots__/demo.test.js.snap index ca7852f3f..7fcde9d9c 100644 --- a/src/tabs/__test__/__snapshots__/demo.test.js.snap +++ b/src/tabs/__test__/__snapshots__/demo.test.js.snap @@ -239,47 +239,6 @@ exports[`Tabs Tabs theme demo works fine 1`] = ` - - - - - - - - - - - - - - - - - - - - - - `; @@ -415,7 +333,7 @@ exports[`Tabs Tabs with-content demo works fine 1`] = ` - 选项二内容 选项二内容 选项二内容 选项二内容 选项二内容 选项二内容 选项二内容 + 选项二内容 - - - - - - - - - - - - diff --git a/src/tabs/_example/with-content/index.wxml b/src/tabs/_example/with-content/index.wxml index e7e3d1413..08a5a11c8 100644 --- a/src/tabs/_example/with-content/index.wxml +++ b/src/tabs/_example/with-content/index.wxml @@ -10,9 +10,7 @@ 选项一内容 - 选项二内容 选项二内容 选项二内容 选项二内容 选项二内容 选项二内容 选项二内容 + 选项二内容 选项三内容 diff --git a/src/tabs/_example/with-content/index.wxss b/src/tabs/_example/with-content/index.wxss index 40eff9294..efd421006 100644 --- a/src/tabs/_example/with-content/index.wxss +++ b/src/tabs/_example/with-content/index.wxss @@ -7,6 +7,9 @@ } .custom-panel__content { + height: 240rpx; + font-size: 28rpx; + color: var(--td-text-color-placeholder); padding: 40rpx; display: flex; justify-content: center; diff --git a/src/tabs/tabs.less b/src/tabs/tabs.less index 7e6b66630..c5f2c2462 100644 --- a/src/tabs/tabs.less +++ b/src/tabs/tabs.less @@ -160,6 +160,16 @@ } } + &__badge { + &--active { + --td-badge-content-text-color: @tab-item-active-color; + } + + &--disabled { + --td-badge-content-text-color: @tab-item-disabled-color; + } + } + &__icon { font-size: @tab-icon-size; margin-right: calc(@spacer / 4); diff --git a/src/tabs/tabs.wxml b/src/tabs/tabs.wxml index 55b455740..611045a21 100644 --- a/src/tabs/tabs.wxml +++ b/src/tabs/tabs.wxml @@ -45,7 +45,10 @@ >