-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Tag): add support of customStyle
close #334
- Loading branch information
1 parent
e782775
commit 294f70a
Showing
8 changed files
with
862 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
### 说明 | ||
|
||
* 这是只有 Icon 的 Tag 组件,用作纯 Icon 标识 | ||
- 这是只有 Icon 的 Tag 组件,用作纯 Icon 标识 | ||
|
||
### 演示 | ||
|
||
* 功能演示 | ||
#### 功能演示 | ||
|
||
```js {"codepath": "icon.jsx"} | ||
``` | ||
|
||
* 样式风格 - styleType | ||
#### 样式风格 - styleType | ||
|
||
```js {"codepath": "icon-styleType.jsx"} | ||
``` | ||
|
||
* 自定义 icon - icon | ||
#### 自定义 icon - icon | ||
|
||
```js {"codepath": "icon-icon.jsx"} | ||
``` | ||
|
||
#### 自定义样式 - customStyle | ||
|
||
```js {"codepath": "icon-customStyle.jsx"} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,8 @@ | |
|
||
```js {"codepath": "tag-icon.jsx"} | ||
``` | ||
|
||
#### 自定义样式 - customStyle | ||
|
||
```js {"codepath": "tag-customStyle.jsx"} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react'; | ||
|
||
import Tag from 'src/components/Tag'; | ||
|
||
// demo start | ||
|
||
class Demo extends React.Component { | ||
render() { | ||
return ( | ||
<div> | ||
<div className="demo-wrap"> | ||
<Tag.Icon icon="circle-fill" styleType="orange" closable></Tag.Icon> | ||
</div> | ||
<div className="demo-wrap"> | ||
<Tag.Icon | ||
icon="circle-fill" | ||
styleType="orange" | ||
closable | ||
customStyle={{ | ||
color: 'white', | ||
background: 'red', | ||
borderColor: 'orange' | ||
}} | ||
></Tag.Icon> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
// demo end | ||
|
||
export default Demo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from 'react'; | ||
|
||
import Tag from 'src/components/Tag'; | ||
|
||
// demo start | ||
|
||
class Demo extends React.Component { | ||
render() { | ||
return ( | ||
<div> | ||
<div className="demo-wrap"> | ||
<Tag icon="circle-fill" styleType="orange" closable> | ||
Content | ||
</Tag> | ||
</div> | ||
<div className="demo-wrap"> | ||
<Tag | ||
icon="circle-fill" | ||
styleType="orange" | ||
closable | ||
customStyle={{ | ||
color: 'white', | ||
background: 'red', | ||
borderColor: 'orange', | ||
closeIconHoverBackground: 'pink' | ||
}} | ||
> | ||
Content | ||
</Tag> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
// demo end | ||
|
||
export default Demo; |
Oops, something went wrong.