mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-20 14:33:49 +00:00
refix #958 by reset form in componentDidUpdate
This commit is contained in:
@@ -12,7 +12,7 @@ const FormItem = Form.Item
|
||||
|
||||
@withI18n()
|
||||
@connect(({ loading }) => ({ loading }))
|
||||
@Form.create({ enableReinitialize: true })
|
||||
@Form.create()
|
||||
class Login extends PureComponent {
|
||||
handleOk = () => {
|
||||
const { dispatch, form } = this.props
|
||||
|
||||
@@ -46,7 +46,7 @@ const requests = Object.values(api).map(item => {
|
||||
})
|
||||
|
||||
let uuid = 2
|
||||
@Form.create({ enableReinitialize: true })
|
||||
@Form.create()
|
||||
class RequestPage extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* global document */
|
||||
import React, { PureComponent } from 'react'
|
||||
import React, { Component } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import moment from 'moment'
|
||||
import { FilterItem } from 'components'
|
||||
@@ -24,8 +24,13 @@ const TwoColProps = {
|
||||
}
|
||||
|
||||
@withI18n()
|
||||
@Form.create({ enableReinitialize: true })
|
||||
class Filter extends PureComponent {
|
||||
@Form.create()
|
||||
class Filter extends Component {
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
if (Object.keys(prevProps.filter).length === 0) {
|
||||
this.handleReset()
|
||||
}
|
||||
}
|
||||
handleFields = fields => {
|
||||
const { createTime } = fields
|
||||
if (createTime.length) {
|
||||
|
||||
@@ -15,7 +15,7 @@ const formItemLayout = {
|
||||
},
|
||||
}
|
||||
@withI18n()
|
||||
@Form.create({ enableReinitialize: true })
|
||||
@Form.create()
|
||||
class UserModal extends PureComponent {
|
||||
handleOk = () => {
|
||||
const { item = {}, onOk, form } = this.props
|
||||
|
||||
Reference in New Issue
Block a user