Skip to content

Commit 033d19a

Browse files
author
yupili
committed
fix 提交漏了
1 parent 745ee29 commit 033d19a

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

src/components/TagList/index.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.tagList {
2+
margin-top: 16px;
3+
text-align: right;
4+
5+
:global {
6+
.ant-tag {
7+
margin-top: 8px;
8+
}
9+
}
10+
}

src/components/TagList/index.tsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import {Tag} from 'antd';
2+
import React, {Component, CSSProperties} from "react";
3+
import {connect} from 'umi';
4+
import {ResourceType} from "@/models/resource";
5+
import styles from "./index.less";
6+
7+
interface TagListProps {
8+
resource: ResourceType;
9+
loading?: boolean;
10+
style?: CSSProperties;
11+
}
12+
13+
class TagList extends Component<TagListProps> {
14+
15+
render() {
16+
const {resource, style} = this.props;
17+
18+
const tagListView = resource.tags && resource.tags.map((tag: string) => {
19+
return <Tag key={tag}>{tag}</Tag>;
20+
})
21+
22+
return (
23+
<div className={styles.tagList} style={style}>
24+
<Tag color="magenta">前端天地</Tag>
25+
<Tag color="orange">网页</Tag>
26+
{tagListView}
27+
</div>
28+
)
29+
}
30+
}
31+
32+
export default connect()(TagList);

0 commit comments

Comments
 (0)