fix: 修复 autoGenerateFilter 导致 crud 加载两次问题 (#3462)

This commit is contained in:
吴多益 2022-01-20 20:35:30 +08:00 committed by GitHub
parent c809b03c6f
commit fda79874f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -465,13 +465,16 @@ export default class CRUD extends React.Component<CRUDProps, any> {
}
componentDidMount() {
const store = this.props.store;
const {store, autoGenerateFilter} = this.props;
if (this.props.perPage) {
store.changePage(store.page, this.props.perPage);
}
if (!this.props.filter || (store.filterTogggable && !store.filterVisible)) {
if (
(!this.props.filter || (store.filterTogggable && !store.filterVisible)) &&
!autoGenerateFilter
) {
this.handleFilterInit({});
}