fix: fix known issues with the form (#4696)

* fix: fix known issues with the form

* chore: typo

* chore: typo
This commit is contained in:
Vben
2024-10-20 22:34:11 +08:00
committed by GitHub
parent 93b48ef244
commit d262b7b6c0
14 changed files with 54 additions and 84 deletions

View File

@@ -22,6 +22,7 @@ export function useExpandable(props: FormRenderProps) {
for (let index = 1; index <= rows; index++) {
maxItem += mapping?.[index] ?? 0;
}
// 保持一行
return maxItem - 1 || 1;
});
@@ -35,6 +36,7 @@ export function useExpandable(props: FormRenderProps) {
if (val) {
await nextTick();
rowMapping.value = {};
isCalculated.value = false;
await calculateRowMapping();
}
},

View File

@@ -279,7 +279,7 @@ function autofocus() {
'flex leading-6',
{
'mr-2 flex-shrink-0 justify-end': !isVertical,
'flex-row': isVertical,
'mb-1 flex-row': isVertical,
},
labelClass,
)

View File

@@ -12,7 +12,7 @@ const props = defineProps<Props>();
</script>
<template>
<FormLabel :class="cn('mb-1 flex items-center', props.class)">
<FormLabel :class="cn('flex items-center', props.class)">
<span v-if="required" class="text-destructive mr-[2px]">*</span>
<slot></slot>
<VbenHelpTooltip v-if="help" trigger-class="size-3.5 ml-1">