antd 的form 表单怎么回显数据_antd Form表单的initialValue问题

在initial中是有初始值的,但是却不显示初始值,请大佬解答一下这个问题

const formItem = [

{ type: 3, label: '柜子编号', name: 'ID', width: '150px', required: true },

{ type: 1, label: '柜子名称', name: 'name', width: '150px', },

{ type: 1, label: '所属仓库', name: 'wareHouse', width: '150px' },

{ type: 1, label: '容量', name: 'capacity', width: '150px' },

{ type: 1, label: '运维人', name: 'people', width: '150px', },

{ type: 3, label: '联系方式', name: 'phoneNum', width: '300px' },

{ type: 1, label: '柜子地址', name: 'address', width: '300px' },

{ type: 2, label: '柜子状态', name: 'status', width: '150px', value: ['停用', '正常'] },

{ type: 1, label: '操作员', name: 'operator', width: '150px' },

];

{formItem.map(i => (

{getFieldDecorator(i.name, {

initialValue: initial ? initial[i.name] : null,

rules: [{ required: i.name === 'ID' ? true : false }]

})((() => {

console.log(initial)

switch (i.type) {

case 1:

return

case 2:

return

{i.value.map(v => ({v}))}

case 3:

return

default:

return null

}

})())}

))}

8c2f778af2c693a69a2913289693d5dd.png

箭头指的地方设置了每一项的初始值,但是表单却没有获取到,确定initial当中是有初始值的,表单却不显示,请大佬解答一下!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值