Skip to content

Commit

Permalink
feat(check-tag): support externalClass (#945)
Browse files Browse the repository at this point in the history
  • Loading branch information
anlyyao authored Oct 28, 2022
1 parent a9104aa commit 8d3775a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/tag/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ isComponent: true
| icon | String / Slot | - | 标签图标 | N |
| shape | String | square | 标签类型,有三种:方形、圆角方形、标记型。可选项:square/round/mark | N |
| size | String | medium | 标签尺寸。可选项:small/medium/large。TS 类型:`SizeEnum` | N |
| external-classes | Array | - | 组件类名,用于设置 组件外层元素元素类名。`['t-class']

### CheckTag Events

Expand Down
2 changes: 2 additions & 0 deletions src/tag/check-tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export default class CheckTag extends SuperComponent {

properties = props;

externalClasses = [`${prefix}-class`];

controlledProps = [
{
key: 'checked',
Expand Down
2 changes: 1 addition & 1 deletion src/tag/check-tag.wxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<view class="{{className}}" bind:tap="handleChange">
<view class="{{className}} {{prefix}}-class" bind:tap="handleChange">
<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 8d3775a

Please sign in to comment.