Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit add1e61b
authored
Apr 30, 2025
by
Netfan
Committed by
GitHub
Apr 30, 2025
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: show validation message as tooltip in compact form (#6087)
* 紧凑模式表单的校验消息将显示为一个tooltip
1 parent
20c15f35
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletions
packages/@core/ui-kit/form-ui/package.json
packages/@core/ui-kit/form-ui/src/form-render/form-field.vue
pnpm-lock.yaml
packages/@core/ui-kit/form-ui/package.json
View file @
add1e61
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
},
},
"dependencies"
:
{
"dependencies"
:
{
"@vben-core/composables"
:
"workspace:*"
,
"@vben-core/composables"
:
"workspace:*"
,
"@vben-core/icons"
:
"workspace:*"
,
"@vben-core/shadcn-ui"
:
"workspace:*"
,
"@vben-core/shadcn-ui"
:
"workspace:*"
,
"@vben-core/shared"
:
"workspace:*"
,
"@vben-core/shared"
:
"workspace:*"
,
"@vben-core/typings"
:
"workspace:*"
,
"@vben-core/typings"
:
"workspace:*"
,
...
...
packages/@core/ui-kit/form-ui/src/form-render/form-field.vue
View file @
add1e61
...
@@ -5,6 +5,7 @@ import type { FormSchema, MaybeComponentProps } from '../types';
...
@@ -5,6 +5,7 @@ import type { FormSchema, MaybeComponentProps } from '../types';
import
{
computed
,
nextTick
,
onUnmounted
,
useTemplateRef
,
watch
}
from
'vue'
;
import
{
computed
,
nextTick
,
onUnmounted
,
useTemplateRef
,
watch
}
from
'vue'
;
import
{
CircleAlert
}
from
'@vben-core/icons'
;
import
{
import
{
FormControl
,
FormControl
,
FormDescription
,
FormDescription
,
...
@@ -12,6 +13,7 @@ import {
...
@@ -12,6 +13,7 @@ import {
FormItem
,
FormItem
,
FormMessage
,
FormMessage
,
VbenRenderContent
,
VbenRenderContent
,
VbenTooltip
,
}
from
'@vben-core/shadcn-ui'
;
}
from
'@vben-core/shadcn-ui'
;
import
{
cn
,
isFunction
,
isObject
,
isString
}
from
'@vben-core/shared/utils'
;
import
{
cn
,
isFunction
,
isObject
,
isString
}
from
'@vben-core/shared/utils'
;
...
@@ -354,6 +356,24 @@ onUnmounted(() => {
...
@@ -354,6 +356,24 @@ onUnmounted(() => {
</
template
>
</
template
>
<!-- <slot></slot> -->
<!-- <slot></slot> -->
</component>
</component>
<VbenTooltip
v-if=
"compact && isInValid"
:delay-duration=
"300"
side=
"left"
>
<
template
#
trigger
>
<slot
name=
"trigger"
>
<CircleAlert
:class=
"
cn(
'text-foreground/80 hover:text-foreground inline-flex size-5 cursor-pointer',
)
"
/>
</slot>
</
template
>
<FormMessage
/>
</VbenTooltip>
</slot>
</slot>
</FormControl>
</FormControl>
<!-- 自定义后缀 -->
<!-- 自定义后缀 -->
...
@@ -365,7 +385,7 @@ onUnmounted(() => {
...
@@ -365,7 +385,7 @@ onUnmounted(() => {
</FormDescription>
</FormDescription>
</div>
</div>
<Transition
name=
"slide-up"
>
<Transition
name=
"slide-up"
v-if=
"!compact"
>
<FormMessage
class=
"absolute bottom-1"
/>
<FormMessage
class=
"absolute bottom-1"
/>
</Transition>
</Transition>
</div>
</div>
...
...
pnpm-lock.yaml
View file @
add1e61
...
@@ -1335,6 +1335,9 @@ importers:
...
@@ -1335,6 +1335,9 @@ importers:
'
@vben-core/composables'
:
'
@vben-core/composables'
:
specifier
:
workspace:*
specifier
:
workspace:*
version
:
link:../../composables
version
:
link:../../composables
'
@vben-core/icons'
:
specifier
:
workspace:*
version
:
link:../../base/icons
'
@vben-core/shadcn-ui'
:
'
@vben-core/shadcn-ui'
:
specifier
:
workspace:*
specifier
:
workspace:*
version
:
link:../shadcn-ui
version
:
link:../shadcn-ui
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment