Skip to content

Commit

Permalink
Merge pull request #738 from Tencent/fix/tag/event-click
Browse files Browse the repository at this point in the history
fix(Tag): use correct event name
  • Loading branch information
LeeJim authored Aug 9, 2022
2 parents db60d3f + 06190eb commit 7623b5b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/tag/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ isComponent: true
| 名称 | 参数 | 描述 |
| ------ | -------------------- | -------------- |
| change | `(checked: boolean)` | 组件子元素 |
| click | - | 点击标签时触发 |
| close | - | 如果关闭按钮存在,点击关闭按钮时触发 |
21 changes: 11 additions & 10 deletions src/tag/common/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@
@tag-medium-icon-size: @font-size * 1.4;
@tag-large-icon-size: @font-size * 1.8;

@tag-small-height: 22px;
@tag-medium-height: 24px;
@tag-large-height: 30px;
@tag-small-height: 44rpx;
@tag-medium-height: 48rpx;
@tag-large-height: 60rpx;

@border-radius-square: 4px;
@tag-border-size: 2rpx;

@border-radius-square: 8rpx;
@border-radius-round: 999px;
@border-radius-mark: @border-radius-round;

Expand All @@ -70,19 +72,18 @@
.@{prefix}-tag {
display: inline-flex;
align-items: center;
border: 2rpx solid transparent;
border: @tag-border-size solid transparent;
box-sizing: border-box;
border-radius: @border-radius-square;
font-size: @tag-medium-font-size;
user-select: none;
vertical-align: middle;

&__text {
word-wrap: normal;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
height: @tag-medium-height;
line-height: @tag-medium-height;
}

&__icon,
Expand All @@ -99,7 +100,7 @@
&.@{prefix}-tag--size {
&-small {
height: @tag-small-height;
line-height: @tag-small-height - 2px;
line-height: @tag-small-height;
padding: 0 @tag-small-padding;
font-size: @tag-small-font-size;

Expand All @@ -111,7 +112,7 @@

&-medium {
height: @tag-medium-height;
line-height: @tag-medium-height - 2px;
line-height: @tag-medium-height;
padding: 0 @tag-medium-padding;
font-size: @tag-medium-font-size;

Expand All @@ -123,7 +124,7 @@

&-large {
height: @tag-large-height;
line-height: @tag-large-height - 2px;
line-height: @tag-large-height;
padding: 0 @tag-large-padding;
font-size: @tag-large-font-size;

Expand Down
2 changes: 1 addition & 1 deletion src/tag/tag.wxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<view class="{{className}} {{prefix}}-class" style="{{tagStyle}}" bind:tap="handleChange">
<view class="{{className}} {{prefix}}-class" style="{{tagStyle}}" bind:tap="handleClick">
<view class="{{classPrefix}}__icon">
<t-icon wx:if="{{icon}}" name="{{icon}}" t-class="{{prefix}}-icon" />
<slot wx:else name="icon" />
Expand Down

0 comments on commit 7623b5b

Please sign in to comment.