feat(form): onChange添加setModel参数,用于修改model并添加至修改记录中
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user