mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-26 00:26:20 +08:00
fix: form required style adjustment (#4668)
This commit is contained in:
@@ -278,7 +278,7 @@ function autofocus() {
|
||||
cn(
|
||||
'flex leading-6',
|
||||
{
|
||||
'mr-2 flex-shrink-0': !isVertical,
|
||||
'mr-2 flex-shrink-0 justify-end': !isVertical,
|
||||
'flex-row': isVertical,
|
||||
},
|
||||
!isVertical && labelClass,
|
||||
|
@@ -1,20 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import { FormLabel, VbenHelpTooltip } from '@vben-core/shadcn-ui';
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
interface Props {
|
||||
class?: string;
|
||||
help?: string;
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
defineProps<Props>();
|
||||
const props = defineProps<Props>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FormLabel class="flex flex-row-reverse items-center">
|
||||
<FormLabel :class="cn('mb-1 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">
|
||||
{{ help }}
|
||||
</VbenHelpTooltip>
|
||||
<slot></slot>
|
||||
<span v-if="required" class="text-destructive mr-[2px]">*</span>
|
||||
</FormLabel>
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user