Skip to content

Commit 5ade59b

Browse files
committed
feat: 优化表格表单
1 parent b0fe11f commit 5ade59b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/ProTableEdit/index.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,7 @@ export default function ProTableEdit<T = any>(props: ProTableEditProps<T>) {
118118
}, [open]);
119119
useEffect(() => {
120120
if (open) {
121-
// 由于modal是出于摧毁状态此时表单还未出现dom创建所以需要加入延时队列 让open先粗发表单创建
122-
setTimeout(() => {
123-
formRef?.current?.setFieldsValue({ ...initData });
124-
}, 0);
121+
formRef?.current?.setFieldsValue({ ...initData });
125122
}
126123
}, [initData?.[String(initDataKey)], initData, open]);
127124

@@ -344,6 +341,7 @@ export default function ProTableEdit<T = any>(props: ProTableEditProps<T>) {
344341
open={open}
345342
onCancel={handleCancel}
346343
destroyOnClose
344+
forceRender
347345
footer={[
348346
<Button
349347
key="reset"

0 commit comments

Comments
 (0)