diff --git a/src/components/Form/src/hooks/useLabelWidth.ts b/src/components/Form/src/hooks/useLabelWidth.ts index 7fcc021e600cae89f73417dc11e6166a57dabdc2..37948351058ca314efcbfda8cb1b1a443d232435 100644 --- a/src/components/Form/src/hooks/useLabelWidth.ts +++ b/src/components/Form/src/hooks/useLabelWidth.ts @@ -10,7 +10,7 @@ export function useItemLabelWidth(schemaItemRef: Ref, propsRef: Ref< const { labelCol = {}, wrapperCol = {} } = schemaItem.itemProps || {}; 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 -------- if (disabledLabelWidth) { @@ -35,7 +35,10 @@ export function useItemLabelWidth(schemaItemRef: Ref, propsRef: Ref< return { labelCol: { style: { width }, ...col }, - wrapperCol: { style: { width: `calc(100% - ${width})` }, ...wrapCol }, + wrapperCol: { + style: { width: layout === 'vertical' ? '100%' : `calc(100% - ${width})` }, + ...wrapCol, + }, }; }); }