pro-components icon indicating copy to clipboard operation
pro-components copied to clipboard

🧐[问题] ProFormList嵌套,无法获取到内部当前行的值

Open shanhuaji opened this issue 3 years ago • 0 comments
trafficstars

<ProForm onFinish={async (e) => console.log(e)}> <ProFormText name="name" label="姓名" /> <ProFormList name="users" label="用户信息" initialValue={[ { name: '1111', }, ]} itemRender={({ listDom, action }, { record }) => { return ( <ProCard bordered extra={action} title={record?.name} style={{ marginBlockEnd: 8, }} > {listDom} </ProCard> ); }} > {(_, index, action) => { return ( <> <ProFormGroup> <ProFormText name="name" label="姓名" fieldProps={{ onChange: () => { console.log(action?.getCurrentRowData()); 可以获取 }, }} /> <ProFormText name="nickName" label="昵称" /> </ProFormGroup> <ProFormList name="labels" label="用户信息" initialValue={[ { value: '333', label: '333', }, ]} copyIconProps={{ tooltipText: '复制此行到末尾', }} deleteIconProps={{ tooltipText: '不需要这行了', }} > {(aa, index1, action1) => { return ( <ProFormGroup key="group"> <ProFormText name="value" label="值" fieldProps={{ onChange: () => { console.log(action1?.getCurrentRowData()); 无法获取 }, }} /> <ProFormText name="label" label="显示名称" /> </ProFormGroup> ); }} </ProFormList> </> ); }} </ProFormList> </ProForm>

shanhuaji avatar Sep 14 '22 01:09 shanhuaji