Skip to content

Commit 4e2a6c4

Browse files
committed
fix: fix cr
1 parent 46ad398 commit 4e2a6c4

File tree

3 files changed

+47
-6
lines changed

3 files changed

+47
-6
lines changed

packages/components/badge/__test__/__snapshots__/demo.test.js.snap

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,23 @@ exports[`Badge Badge theme demo works fine 1`] = `
254254
<t-cell
255255
tClass="t-class-cell"
256256
title="单行标题"
257+
>
258+
<t-badge
259+
count="NEW"
260+
offset="{{
261+
Array [
262+
0,
263+
0,
264+
]
265+
}}"
266+
shape="ribbon-left"
267+
slot="note"
268+
/>
269+
</t-cell>
270+
<t-cell
271+
bordered="{{false}}"
272+
tClass="t-class-cell"
273+
title="单行标题"
257274
>
258275
<t-badge
259276
count="NEW"
@@ -276,6 +293,23 @@ exports[`Badge Badge theme demo works fine 1`] = `
276293
<t-cell
277294
tClass="t-class-cell"
278295
title="单行标题"
296+
>
297+
<t-badge
298+
count="NEW"
299+
offset="{{
300+
Array [
301+
0,
302+
0,
303+
]
304+
}}"
305+
shape="triangle-left"
306+
slot="note"
307+
/>
308+
</t-cell>
309+
<t-cell
310+
bordered="{{false}}"
311+
tClass="t-class-cell"
312+
title="单行标题"
279313
>
280314
<t-badge
281315
count="NEW"

packages/components/badge/_example/theme/index.wxml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,16 @@
2828

2929
<view class="demo-desc" style="margin-bottom: 32rpx">角标</view>
3030
<t-cell title="单行标题" t-class="t-class-cell">
31+
<t-badge count="NEW" offset="{{skylineRender ? ['-18rpx', '-32rpx']: [0, 0]}}" shape="ribbon-left" slot="note" />
32+
</t-cell>
33+
<t-cell title="单行标题" bordered="{{false}}" t-class="t-class-cell">
3134
<t-badge count="NEW" offset="{{skylineRender ? ['-18rpx', '-32rpx']: [0, 0]}}" shape="ribbon" slot="note" />
3235
</t-cell>
3336

3437
<view class="demo-desc" style="margin-bottom: 32rpx">三角角标</view>
3538
<t-cell title="单行标题" t-class="t-class-cell">
39+
<t-badge count="NEW" offset="{{skylineRender ? ['-24rpx', '-32rpx']: [0, 0]}}" shape="triangle-left" slot="note" />
40+
</t-cell>
41+
<t-cell title="单行标题" bordered="{{false}}" t-class="t-class-cell">
3642
<t-badge count="NEW" offset="{{skylineRender ? ['-24rpx', '-32rpx']: [0, 0]}}" shape="triangle-right" slot="note" />
3743
</t-cell>

packages/components/badge/badge.less

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898

9999
&--ribbon,
100100
&--ribbon-right {
101-
background: linear-gradient(45deg, transparent 50%, @badge-color 50%, @badge-color 82%, transparent 82%);
101+
background: linear-gradient(45deg, transparent 50%, @badge-color 50%, @badge-color 85%, transparent 85%);
102102
}
103103

104104
&--triangle-right {
@@ -111,12 +111,12 @@
111111
right: 0;
112112

113113
.@{prefix}-badge__count {
114-
transform: rotate(45deg) translateY(calc(-1 * var(--td-line-height-mark-extraSmall, 32rpx) / 2 + 2rpx));
114+
transform: rotate(45deg) translateY(calc(-1 * var(--td-line-height-mark-extraSmall, 32rpx) / 2 + 1rpx));
115115
}
116116
}
117117

118118
&--ribbon-left {
119-
background: linear-gradient(-45deg, transparent 50%, @badge-color 50%, @badge-color 82%, transparent 82%);
119+
background: linear-gradient(-45deg, transparent 50%, @badge-color 50%, @badge-color 85%, transparent 85%);
120120
}
121121

122122
&--triangle-left {
@@ -128,7 +128,7 @@
128128
left: 0;
129129

130130
.@{prefix}-badge__count {
131-
transform: rotate(-45deg) translateY(calc(-1 * var(--td-line-height-mark-extraSmall, 32rpx) / 2 + 2rpx));
131+
transform: rotate(-45deg) translateY(calc(-1 * var(--td-line-height-mark-extraSmall, 32rpx) / 2 + 1rpx));
132132
}
133133
}
134134

@@ -151,20 +151,21 @@
151151
&--large&--triangle-left {
152152
width: calc(@badge-large-height * 2);
153153
height: calc(@badge-large-height * 2);
154+
padding: 0;
154155
}
155156

156157
&--large&--ribbon,
157158
&--large&--ribbon-right,
158159
&--large&--triangle-right {
159160
.@{prefix}-badge__count {
160-
transform: rotate(45deg) translateY(calc(-1 * var(--td-line-height-mark-small, 40rpx) / 2 + 2rpx));
161+
transform: rotate(45deg) translateY(calc(-1 * var(--td-line-height-mark-small, 40rpx) / 2 + 3rpx));
161162
}
162163
}
163164

164165
&--large&--ribbon-left,
165166
&--large&--triangle-left {
166167
.@{prefix}-badge__count {
167-
transform: rotate(-45deg) translateY(calc(-1 * var(--td-line-height-mark-small, 40rpx) / 2 + 2rpx));
168+
transform: rotate(-45deg) translateY(calc(-1 * var(--td-line-height-mark-small, 40rpx) / 2 + 3rpx));
168169
}
169170
}
170171

0 commit comments

Comments
 (0)