File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed
Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ .tagList {
2+ margin-top : 16px ;
3+ text-align : right ;
4+
5+ :global {
6+ .ant-tag {
7+ margin-top : 8px ;
8+ }
9+ }
10+ }
Original file line number Diff line number Diff line change 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 ) ;
You can’t perform that action at this time.
0 commit comments