Skip to content

Commit 8af6d71

Browse files
authored
feat(tag): update icon (#2713)
* feat(tag): update icon * feat(tag): update icon * feat(tag): update icon
1 parent a054cc8 commit 8af6d71

File tree

2 files changed

+9
-21
lines changed

2 files changed

+9
-21
lines changed

src/packages/tag/demos/taro/demo2.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
// import { Failure } from '@nutui/icons-react-taro'
2+
import { Failure } from '@nutui/icons-react-taro'
33
import { Cell, Tag } from '@nutui/nutui-react-taro'
44
import Taro from '@tarojs/taro'
55

@@ -41,9 +41,7 @@ const Demo2 = () => {
4141
extra={
4242
<Tag
4343
closeable
44-
// TODO: icon 适配
45-
closeIcon="C"
46-
// closeIcon={<Failure size={8} />}
44+
closeIcon={<Failure size={8} />}
4745
onClose={() => Taro.showToast({ title: 'Tag closed' })}
4846
type="primary"
4947
>

src/packages/tag/tag.taro.tsx

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
import type { MouseEvent } from 'react'
12
import React, {
23
CSSProperties,
34
FunctionComponent,
4-
useState,
55
ReactNode,
6+
useState,
67
} from 'react'
7-
import type { MouseEvent } from 'react'
8-
import { View, ITouchEvent, Text } from '@tarojs/components'
9-
// import { Close } from '@nutui/icons-react-taro'
8+
import { ITouchEvent, View } from '@tarojs/components'
9+
import { Close } from '@nutui/icons-react-taro'
1010
import classNames from 'classnames'
1111

1212
import { BasicComponent, ComponentDefaults } from '@/utils/typings'
@@ -132,23 +132,13 @@ export const Tag: FunctionComponent<Partial<TagProps>> = (props) => {
132132
{closeIcon}
133133
</View>
134134
) : (
135-
// TODO: icon 适配
136-
// <Close
137-
// size={8}
138-
// onClick={(e) => {
139-
// setVisible(false)
140-
// onClose && onClose(e)
141-
// }}
142-
// />
143-
<Text
135+
<Close
136+
size={8}
144137
onClick={(e) => {
145138
setVisible(false)
146139
onClose && onClose(e)
147140
}}
148-
className={`${classPrefix}-custom-icon`}
149-
>
150-
X
151-
</Text>
141+
/>
152142
)}
153143
</View>
154144
)

0 commit comments

Comments
 (0)