vertical 布局时页面布局显示错乱问题解决

pull/170/head^2
zhangdaiscott 2022-09-29 15:06:50 +08:00
parent 232ae69dd4
commit 8e33da231e
2 changed files with 10 additions and 3 deletions

View File

@ -10,7 +10,7 @@ export function useItemLabelWidth(schemaItemRef: Ref<FormSchema>, propsRef: Ref<
const { labelCol = {}, wrapperCol = {} } = schemaItem.itemProps || {}; const { labelCol = {}, wrapperCol = {} } = schemaItem.itemProps || {};
const { labelWidth, disabledLabelWidth } = schemaItem; const { labelWidth, disabledLabelWidth } = schemaItem;
const { labelWidth: globalLabelWidth, labelCol: globalLabelCol, wrapperCol: globWrapperCol } = unref(propsRef); const { labelWidth: globalLabelWidth, labelCol: globalLabelCol, wrapperCol: globWrapperCol,layout } = unref(propsRef);
// update-begin--author:sunjianlei---date:20211104---for: 禁用全局 labelWidth不自动设置 textAlign -------- // update-begin--author:sunjianlei---date:20211104---for: 禁用全局 labelWidth不自动设置 textAlign --------
if (disabledLabelWidth) { if (disabledLabelWidth) {
@ -34,8 +34,11 @@ export function useItemLabelWidth(schemaItemRef: Ref<FormSchema>, propsRef: Ref<
} }
return { return {
labelCol: { style: { width }, ...col }, labelCol: { style: { width: width ? width : '100%' }, ...col },
wrapperCol: { style: { width: `calc(100% - ${width})` }, ...wrapCol }, wrapperCol: {
style: { width: layout === 'vertical' ? '100%' : `calc(100% - ${width})` },
...wrapCol,
},
}; };
}); });
} }

View File

@ -33,6 +33,8 @@
baseColProps: { baseColProps: {
span: 6, span: 6,
}, },
labelWidth: 200,
layout: 'vertical',
schemas: schemas, schemas: schemas,
showActionButtonGroup: false, showActionButtonGroup: false,
}); });
@ -41,6 +43,8 @@
baseColProps: { baseColProps: {
span: 6, span: 6,
}, },
labelWidth: 200,
layout: 'vertical',
schemas: taskSchemas, schemas: taskSchemas,
showActionButtonGroup: false, showActionButtonGroup: false,
}); });