Commit 56a07488 authored by afc163's avatar afc163

Fix rerender bug of ListContent

the definition should not be placed in render

close #1922
parent 1fb2185d
...@@ -24,6 +24,22 @@ const RadioButton = Radio.Button; ...@@ -24,6 +24,22 @@ const RadioButton = Radio.Button;
const RadioGroup = Radio.Group; const RadioGroup = Radio.Group;
const { Search } = Input; const { Search } = Input;
const ListContent = ({ data: { owner, createdAt, percent, status } }) => (
<div className={styles.listContent}>
<div className={styles.listContentItem}>
<span>Owner</span>
<p>{owner}</p>
</div>
<div className={styles.listContentItem}>
<span>开始时间</span>
<p>{moment(createdAt).format('YYYY-MM-DD HH:mm')}</p>
</div>
<div className={styles.listContentItem}>
<Progress percent={percent} status={status} strokeWidth={6} style={{ width: 180 }} />
</div>
</div>
);
@connect(({ list, loading }) => ({ @connect(({ list, loading }) => ({
list, list,
loading: loading.models.list, loading: loading.models.list,
...@@ -71,22 +87,6 @@ export default class BasicList extends PureComponent { ...@@ -71,22 +87,6 @@ export default class BasicList extends PureComponent {
total: 50, total: 50,
}; };
const ListContent = ({ data: { owner, createdAt, percent, status } }) => (
<div className={styles.listContent}>
<div className={styles.listContentItem}>
<span>Owner</span>
<p>{owner}</p>
</div>
<div className={styles.listContentItem}>
<span>开始时间</span>
<p>{moment(createdAt).format('YYYY-MM-DD HH:mm')}</p>
</div>
<div className={styles.listContentItem}>
<Progress percent={percent} status={status} strokeWidth={6} style={{ width: 180 }} />
</div>
</div>
);
const menu = ( const menu = (
<Menu> <Menu>
<Menu.Item> <Menu.Item>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment