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 fc9ea347
authored
Jul 18, 2025
by
panda7
Committed by
GitHub
Jul 18, 2025
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'main' into feat/add-vben-modal-animation
2 parents
1a9b0509
07b64ad3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
5 deletions
docs/src/components/common-ui/vben-form.md
packages/@core/ui-kit/form-ui/src/form-render/form.vue
packages/@core/ui-kit/form-ui/src/types.ts
docs/src/components/common-ui/vben-form.md
View file @
fc9ea34
...
@@ -395,7 +395,7 @@ export interface FormCommonConfig {
...
@@ -395,7 +395,7 @@ export interface FormCommonConfig {
* 所有表单项的栅格布局
* 所有表单项的栅格布局
* @default ""
* @default ""
*/
*/
formItemClass
?:
string
;
formItemClass
?:
(()
=>
string
)
|
string
;
/**
/**
* 隐藏所有表单项label
* 隐藏所有表单项label
* @default false
* @default false
...
...
packages/@core/ui-kit/form-ui/src/form-render/form.vue
View file @
fc9ea34
...
@@ -12,7 +12,12 @@ import type {
...
@@ -12,7 +12,12 @@ import type {
import
{
computed
}
from
'vue'
;
import
{
computed
}
from
'vue'
;
import
{
Form
}
from
'@vben-core/shadcn-ui'
;
import
{
Form
}
from
'@vben-core/shadcn-ui'
;
import
{
cn
,
isString
,
mergeWithArrayOverride
}
from
'@vben-core/shared/utils'
;
import
{
cn
,
isFunction
,
isString
,
mergeWithArrayOverride
,
}
from
'@vben-core/shared/utils'
;
import
{
provideFormRenderProps
}
from
'./context'
;
import
{
provideFormRenderProps
}
from
'./context'
;
import
{
useExpandable
}
from
'./expandable'
;
import
{
useExpandable
}
from
'./expandable'
;
...
@@ -110,6 +115,17 @@ const computedSchema = computed(
...
@@ -110,6 +115,17 @@ const computedSchema = computed(
?
keepIndex
<=
index
?
keepIndex
<=
index
:
false
;
:
false
;
// 处理函数形式的formItemClass
let
resolvedSchemaFormItemClass
=
schema
.
formItemClass
;
if
(
isFunction
(
schema
.
formItemClass
))
{
try
{
resolvedSchemaFormItemClass
=
schema
.
formItemClass
();
}
catch
(
error
)
{
console
.
error
(
'Error calling formItemClass function:'
,
error
);
resolvedSchemaFormItemClass
=
''
;
}
}
return
{
return
{
colon
,
colon
,
disabled
,
disabled
,
...
@@ -133,7 +149,7 @@ const computedSchema = computed(
...
@@ -133,7 +149,7 @@ const computedSchema = computed(
'flex-shrink-0'
,
'flex-shrink-0'
,
{
hidden
},
{
hidden
},
formItemClass
,
formItemClass
,
schema
.
f
ormItemClass
,
resolvedSchemaF
ormItemClass
,
),
),
labelClass
:
cn
(
labelClass
,
schema
.
labelClass
),
labelClass
:
cn
(
labelClass
,
schema
.
labelClass
),
};
};
...
...
packages/@core/ui-kit/form-ui/src/types.ts
View file @
fc9ea34
...
@@ -174,10 +174,10 @@ export interface FormCommonConfig {
...
@@ -174,10 +174,10 @@ export interface FormCommonConfig {
*/
*/
formFieldProps
?:
FormFieldOptions
;
formFieldProps
?:
FormFieldOptions
;
/**
/**
* 所有表单项的栅格布局
* 所有表单项的栅格布局
,支持函数形式
* @default ""
* @default ""
*/
*/
formItemClass
?:
string
;
formItemClass
?:
(()
=>
string
)
|
string
;
/**
/**
* 隐藏所有表单项label
* 隐藏所有表单项label
* @default false
* @default false
...
...
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