Skip to content

Commit

Permalink
Merge branch 'Tencent:develop' into feature/skylerxie_tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
SkylerXie authored Jan 5, 2025
2 parents b360b84 + f95e76f commit 41d34d6
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ exports[`PullDownRefresh PullDownRefresh base demo works fine 1`] = `
title="PullDownRefresh 下拉刷新"
/>
<wx-view
class="pulldown-reflesh__content"
class="pulldown-refresh__content"
>
<t-skeleton
loading="{{true}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ exports[`PullDownRefresh PullDownRefresh base demo works fine 1`] = `
用于快速刷新页面信息,刷新可以是整页刷新也可以是页面的局部刷新。
</wx-view>
<wx-view
class="pulldown-reflesh__content"
class="pulldown-refresh__content"
>
<t-skeleton
loading="{{true}}"
Expand Down
2 changes: 1 addition & 1 deletion src/pull-down-refresh/_example/base/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
desc="用于快速刷新页面信息,刷新可以是整页刷新也可以是页面的局部刷新。"
notice="渲染框架支持情况:WebView"
/>
<view class="pulldown-reflesh__content">
<view class="pulldown-refresh__content">
<t-skeleton rowCol="{{rowCol1}}" loading></t-skeleton>
<view class="row">
<t-skeleton rowCol="{{rowCol2}}" loading></t-skeleton>
Expand Down
2 changes: 1 addition & 1 deletion src/pull-down-refresh/_example/base/index.wxss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
line-height: 44rpx;
}

.pulldown-reflesh__content {
.pulldown-refresh__content {
margin: 64rpx 32rpx 0;
position: relative;
}
Expand Down
84 changes: 1 addition & 83 deletions src/tabs/__test__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -239,47 +239,6 @@ exports[`Tabs Tabs theme demo works fine 1`] = `
<wx-view
style="height: 16px"
/>
<t-tabs
defaultValue="{{0}}"
spaceEvenly="{{false}}"
theme="tag"
>
<t-tab-panel
label="选项"
value="{{0}}"
/>
<t-tab-panel
label="选项"
value="{{1}}"
/>
<t-tab-panel
label="选项"
value="{{2}}"
/>
<t-tab-panel
label="选项"
value="{{3}}"
/>
<t-tab-panel
label="选项"
value="{{4}}"
/>
<t-tab-panel
label="选项"
value="{{5}}"
/>
<t-tab-panel
label="选项"
value="{{6}}"
/>
<t-tab-panel
label="选项"
value="{{7}}"
/>
</t-tabs>
<wx-view
style="height: 16px"
/>
<t-tabs
defaultValue="{{0}}"
theme="card"
Expand All @@ -301,47 +260,6 @@ exports[`Tabs Tabs theme demo works fine 1`] = `
value="{{3}}"
/>
</t-tabs>
<wx-view
style="height: 16px"
/>
<t-tabs
defaultValue="{{0}}"
spaceEvenly="{{false}}"
theme="card"
>
<t-tab-panel
label="选项"
value="{{0}}"
/>
<t-tab-panel
label="选项"
value="{{1}}"
/>
<t-tab-panel
label="选项"
value="{{2}}"
/>
<t-tab-panel
label="选项"
value="{{3}}"
/>
<t-tab-panel
label="选项"
value="{{4}}"
/>
<t-tab-panel
label="选项"
value="{{5}}"
/>
<t-tab-panel
label="选项"
value="{{6}}"
/>
<t-tab-panel
label="选项"
value="{{7}}"
/>
</t-tabs>
</theme>
`;

Expand Down Expand Up @@ -415,7 +333,7 @@ exports[`Tabs Tabs with-content demo works fine 1`] = `
<wx-view
class="custom-panel__content"
>
选项二内容 选项二内容 选项二内容 选项二内容 选项二内容 选项二内容 选项二内容
选项二内容
</wx-view>
</t-tab-panel>
<t-tab-panel
Expand Down
2 changes: 1 addition & 1 deletion src/tabs/_example/size/index.wxss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.bigger {
--tab-font-size: 32rpx;
--td-tab-font-size: 32rpx;
}
12 changes: 0 additions & 12 deletions src/tabs/_example/theme/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@

<view style="height: 16px" />

<t-tabs defaultValue="{{0}}" theme="tag" space-evenly="{{false}}">
<t-tab-panel wx:for="{{8}}" wx:key="index" label="选项" value="{{index}}" />
</t-tabs>

<view style="height: 16px" />

<t-tabs defaultValue="{{0}}" theme="card">
<t-tab-panel wx:for="{{4}}" wx:key="index" label="选项" value="{{index}}" />
</t-tabs>

<view style="height: 16px" />

<t-tabs defaultValue="{{0}}" theme="card" space-evenly="{{false}}">
<t-tab-panel wx:for="{{8}}" wx:key="index" label="选项" value="{{index}}" />
</t-tabs>
4 changes: 1 addition & 3 deletions src/tabs/_example/with-content/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
<view class="custom-panel__content">选项一内容</view>
</t-tab-panel>
<t-tab-panel label="选项二" value="1">
<view class="custom-panel__content"
>选项二内容 选项二内容 选项二内容 选项二内容 选项二内容 选项二内容 选项二内容</view
>
<view class="custom-panel__content">选项二内容</view>
</t-tab-panel>
<t-tab-panel label="选项三" value="2">
<view class="custom-panel__content">选项三内容</view>
Expand Down
3 changes: 3 additions & 0 deletions src/tabs/_example/with-content/index.wxss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions src/tabs/tabs.less
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion src/tabs/tabs.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@
>
<template wx:if="{{item.icon}}" is="icon" data="{{ tClass: classPrefix + '__icon', ...item.icon }}" />
<block wx:if="{{item.badgeProps}}">
<template is="badge" data="{{ ...item.badgeProps, content: item.label }}" />
<template
is="badge"
data="{{ ...item.badgeProps, content: item.label, tClass: _.cls(classPrefix + '__badge', [ ['disabled', item.disabled], ['active', currentIndex === index]])}}"
/>
</block>
<block wx:else>{{item.label}}</block>
</view>
Expand Down

0 comments on commit 41d34d6

Please sign in to comment.