Unverified Commit 4b2db7c3 authored by afc163's avatar afc163

use Link over router.push

parent 348c6284
import React, { PureComponent, Fragment } from 'react'; import React, { PureComponent, Fragment } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import moment from 'moment'; import moment from 'moment';
import router from 'umi/router'; import Link from 'umi/link';
import { import {
Row, Row,
Col, Col,
...@@ -293,7 +293,7 @@ class TableList extends PureComponent { ...@@ -293,7 +293,7 @@ class TableList extends PureComponent {
{ {
title: 'θ§„εˆ™εη§°', title: 'θ§„εˆ™εη§°',
dataIndex: 'name', dataIndex: 'name',
render: text => <a onClick={() => this.previewItem(text)}>{text}</a>, render: text => <Link to={`/profile/basic/${text.replace(/\s+/gi, '-')}`}>{text}</Link>,
}, },
{ {
title: '描述', title: '描述',
...@@ -383,10 +383,6 @@ class TableList extends PureComponent { ...@@ -383,10 +383,6 @@ class TableList extends PureComponent {
}); });
}; };
previewItem = id => {
router.push(`/profile/basic/${id}`);
};
handleFormReset = () => { handleFormReset = () => {
const { form, dispatch } = this.props; const { form, dispatch } = this.props;
form.resetFields(); form.resetFields();
......
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