@@ -2,7 +2,7 @@
|
||||
<div
|
||||
v-if="display()"
|
||||
:id="`${config.id || ''}`"
|
||||
:class="`magic-ui-container${config.className ? ` ${config.className}` : ''}`"
|
||||
:class="`magic-ui-container magic-layout-${config.layout}${config.className ? ` ${config.className}` : ''}`"
|
||||
:style="style"
|
||||
>
|
||||
<slot></slot>
|
||||
|
||||
@@ -26,5 +26,16 @@ export default [
|
||||
{ value: 'absolute', text: '绝对定位' },
|
||||
{ value: 'relative', text: '流式布局' },
|
||||
],
|
||||
onChange: (formState: any, v: string, { model }: any) => {
|
||||
if (!model.style) return v;
|
||||
if (v === 'relative') {
|
||||
model.style.height = 'auto';
|
||||
} else {
|
||||
const el = formState.stage?.renderer?.contentWindow.document.getElementById(model.id);
|
||||
if (el) {
|
||||
model.style.height = el.getBoundingClientRect().height;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user