小编Jid*_*ide的帖子

如果 initialValue 改变,则更新 antd 表单

我正在将当前用户数据从我的 Redux-saga 传递到 antd 表单中,姓名、电子邮件、电话号码、介绍作为初始值传递给表单,我想要做的是我想将表单作为放置请求提交给数据库,如果初始值已更改.. 这是我的代码

import React  from 'react';
import {createStructuredSelector} from 'reselect';
import { connect } from 'react-redux';
import { selectCurrentUser } from '../../redux/user/user.selector';



import { Form, Input, Button } from 'antd';

import './profile_form.styles.css'

/* eslint-disable no-template-curly-in-string */
const ProfileForm = ({currentUser}) => {
  const {name, email} = currentUser


  const onFinish = values => {
    console.log(values);
  };

  const layout = {
    labelCol: {
      span: 7,
    },
    wrapperCol: {
      span: 15,
    },
  };


  return (
    <Form className='profile-form' {...layout} 
    onFinish={onFinish} …
Run Code Online (Sandbox Code Playgroud)

reactjs antd

12
推荐指数
2
解决办法
6378
查看次数

标签 统计

antd ×1

reactjs ×1