chore: 更改postMessage参数

This commit is contained in:
dap
2024-12-18 10:08:02 +08:00
parent ada0a7edf6
commit f56ba6ba33
2 changed files with 8 additions and 5 deletions

View File

@@ -60,14 +60,14 @@ onMounted(async () => {
*/
if (readonly) {
// 渲染完毕才显示表单
window.parent.postMessage('mounted', '*');
window.parent.postMessage({ type: 'mounted' }, '*');
// 获取表单高度 内嵌时保持一致
setTimeout(() => {
const el = cardRef.value?.$el as HTMLDivElement;
// 获取高度
const height = el?.offsetHeight ?? 0;
if (height) {
window.parent.postMessage(`height:${height}`, '*');
window.parent.postMessage({ type: 'height', height }, '*');
}
});
}