|
@@ -1,7 +1,6 @@
|
|
|
import type { Ref } from 'vue';
|
|
|
-import type { FormProps, FormSchema } from '../types/form';
|
|
|
-
|
|
|
import { computed, unref } from 'vue';
|
|
|
+import type { FormProps, FormSchema } from '../types/form';
|
|
|
import { isNumber } from '/@/utils/is';
|
|
|
|
|
|
export function useItemLabelWidth(schemaItemRef: Ref<FormSchema>, propsRef: Ref<FormProps>) {
|
|
@@ -14,6 +13,7 @@ export function useItemLabelWidth(schemaItemRef: Ref<FormSchema>, propsRef: Ref<
|
|
|
labelWidth: globalLabelWidth,
|
|
|
labelCol: globalLabelCol,
|
|
|
wrapperCol: globWrapperCol,
|
|
|
+ layout,
|
|
|
} = unref(propsRef);
|
|
|
|
|
|
// If labelWidth is set globally, all items setting
|
|
@@ -33,7 +33,10 @@ export function useItemLabelWidth(schemaItemRef: Ref<FormSchema>, propsRef: Ref<
|
|
|
|
|
|
return {
|
|
|
labelCol: { style: { width }, ...col },
|
|
|
- wrapperCol: { style: { width: `calc(100% - ${width})` }, ...wrapCol },
|
|
|
+ wrapperCol: {
|
|
|
+ style: { width: layout === 'vertical' ? '100%' : `calc(100% - ${width})` },
|
|
|
+ ...wrapCol,
|
|
|
+ },
|
|
|
};
|
|
|
});
|
|
|
}
|