Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 单击“确定”按钮后,立即禁用Ant Design Mode Confirm Cancel按钮_Reactjs_Antd_Ant Design Pro - Fatal编程技术网

Reactjs 单击“确定”按钮后,立即禁用Ant Design Mode Confirm Cancel按钮

Reactjs 单击“确定”按钮后,立即禁用Ant Design Mode Confirm Cancel按钮,reactjs,antd,ant-design-pro,Reactjs,Antd,Ant Design Pro,实际上不起作用,因为它不会立即选择状态中的更新。只有在您单击“取消”按钮并重新启动“模式确认”后,它才起作用。而不是依赖随附的“禁用”按钮 confirm({ cancelButtonProps: { disabled: this.state.processing }, onOk: () => { return new Promise((resolve, reject) => { this.setState({ process


实际上不起作用,因为它不会立即选择状态中的更新。只有在您单击“取消”按钮并重新启动“模式确认”后,它才起作用。

而不是依赖随附的“禁用”按钮


confirm({
  cancelButtonProps: {
    disabled: this.state.processing
  },
  onOk: () => {
    return new Promise((resolve, reject) => {
      this.setState({
        processing: true
      })
    })
  }
})
就用这个吧

cancelButtonProps
confirm({
  cancelButtonProps: {
    onClick: () => {
      if (this.state.processing) {
        alert('You cant cancel, processing still un-going')
      } else {
        Modal.destroyAll() //use Modal.destroyAll() to destroy the confirm modal
      }
    }
  },
  onOk: () => {
    return new Promise((resolve, reject) => {
      this.setState({
        processing: true
      })
    })
  }
})