chore: iframe通信 加载完毕后才显示表单 解决卡顿问题

This commit is contained in:
dap
2024-12-17 09:23:54 +08:00
parent 06f76bea0a
commit 34d091adfa
3 changed files with 22 additions and 87 deletions

View File

@@ -52,6 +52,14 @@ onMounted(async () => {
await formApi.setValues(resp);
const dateRange = [dayjs(resp.startDate), dayjs(resp.endDate)];
await formApi.setFieldValue('dateRange', dateRange);
/**
* window.parent最近的上一级父页面
* 主要解决内嵌iframe卡顿的问题
*/
if (readonly) {
window.parent.postMessage('mounted', '*');
}
}
});