Skip to content

Commit

Permalink
fix: form required style adjustment (#4668)
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb authored Oct 17, 2024
1 parent c432e0a commit f89f4f3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 6 additions & 4 deletions packages/@core/ui-kit/form-ui/src/form-render/form-label.vue
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>
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ const { authPanelCenter, authPanelLeft, authPanelRight, isDark } =
</AuthenticationFormView>

<!-- 头部 Logo 和应用名称 -->
<div class="absolute left-0 top-0 z-10 flex flex-1">
<div v-if="logo || appName" class="absolute left-0 top-0 z-10 flex flex-1">
<div
class="text-foreground lg:text-foreground ml-4 mt-4 flex flex-1 items-center sm:left-6 sm:top-6"
>
<img :alt="appName" :src="logo" class="mr-2" width="42" />
<p class="text-xl font-medium">
<img v-if="logo" :alt="appName" :src="logo" class="mr-2" width="42" />
<p v-if="appName" class="text-xl font-medium">
{{ appName }}
</p>
</div>
Expand Down

0 comments on commit f89f4f3

Please sign in to comment.