-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: form required style adjustment (#4668)
- Loading branch information
Showing
3 changed files
with
10 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
packages/@core/ui-kit/form-ui/src/form-render/form-label.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters