1
0
mirror of synced 2026-03-22 18:48:34 +08:00

feat(form): onChange添加setModel参数,用于修改model并添加至修改记录中

This commit is contained in:
roymondchen
2025-04-21 19:42:22 +08:00
parent 31515c4046
commit 5e0e776d40
14 changed files with 70 additions and 47 deletions

View File

@@ -28,14 +28,14 @@ export default [
{ value: 'absolute', text: '绝对定位' },
{ value: 'relative', text: '流式布局' },
],
onChange: (formState: any, v: string, { model }: any) => {
onChange: (formState: any, v: string, { setModel, model }: any) => {
if (!model.style) return v;
if (v === 'relative') {
model.style.height = 'auto';
setModel('style.height', 'auto');
} else {
const el = getElById()(formState.stage?.renderer?.contentWindow.document, model.id);
if (el) {
model.style.height = el.getBoundingClientRect().height;
setModel('style.height', el.getBoundingClientRect().height);
}
}
},