Commit bd233ac9 by haojie

1

parent d2cd6295
......@@ -81,20 +81,21 @@ export default class StartTrade extends Component<any, any> {
onReset = () => {
const items = Object.keys(this.state);
items.forEach((item: any) => {
if (typeof this.state[item] === 'string') {
this.setState({
[item]: ''
})
} else if (typeof this.state[item] === 'number') {
this.setState({
[item]: 0,
})
} else {
this.setState({
[item]: []
})
if (!noSubmitFields.includes(item)) {
if (typeof this.state[item] === 'string') {
this.setState({
[item]: ''
})
} else if (typeof this.state[item] === 'number') {
this.setState({
[item]: 0,
})
} else {
this.setState({
[item]: []
})
}
}
})
console.log(this.state)
}
......
......@@ -70,20 +70,22 @@ export default class TradeDialog extends Component<any, any> {
onReset = () => {
const items = Object.keys(this.state);
items.forEach((item: any) => {
if (typeof this.state[item] === 'string') {
this.setState({
[item]: ''
})
} else if (typeof this.state[item] === 'number') {
this.setState({
[item]: 0,
})
} else {
this.setState({
[item]: []
})
// 跳过不提交的字段
if (!noSubmitFields.includes(item)) {
if (typeof this.state[item] === 'string') {
this.setState({
[item]: ''
})
} else if (typeof this.state[item] === 'number') {
this.setState({
[item]: 0,
})
} else {
this.setState({
[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