提交 19996b0b authored 作者: vipcxj's avatar vipcxj

fix: DsTable无限刷新自身

上级 0c4d1633
......@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { Divider } from 'antd';
import modelCreator from './model';
import connect from '../../hoc/stateful';
import TableEx from '../../../components/table/index';
import TableEx from '../index';
import { push } from '../../../services/route';
import { shallowEqual, arrayJoin } from '../../../utils/helper';
import styles from './index.less';
......@@ -30,7 +30,11 @@ const renderButton = (meta) => {
};
// noinspection JSUnresolvedVariable
return (
<a onClick={onClick} onKeyDown={onKeyDown}> {meta.buttonName || 'link'} </a>
<a onClick={onClick} onKeyDown={onKeyDown}>
{' '}
{meta.buttonName || 'link'}
{' '}
</a>
);
}
throw new Error(`Unsupported button meta: ${JSON.stringify(meta)}.`);
......@@ -45,7 +49,7 @@ class DsTable extends React.Component {
componentWillReceiveProps(nextProps) {
const { coordinate, params, current, start, end } = nextProps;
const { dispatchLocal } = this.props;
if (!shallowEqual(coordinate, this.props.coordinate) || !shallowEqual(params, this.props.params || current !== this.props.current)) {
if (!shallowEqual(coordinate, this.props.coordinate) || !shallowEqual(params, this.props.params) || current !== this.props.current) {
dispatchLocal({ type: 'doInit', payload: { coordinate, params, current, start, end } });
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论