1、发送数据
parent.postMessage({
url: moduleUrl,
options: params,
ifRefreshTarget: true,
});
2、 接受数据
useEffect(() => {
const urlParams = new URLSearchParams(window.location.search);
const params = {};
for (const [key, value] of urlParams.entries()) {
params[key] = value;
}
const { ...rest} = params;
formRef.current?.setFieldsValue({...rest});
formRef.current?.submit();
}, []);