Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/src/components/common-ui/vben-form.md
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,8 @@ export interface FormSchema<
fieldName: string;
/** 帮助信息 */
help?: CustomRenderType;
/** 是否隐藏表单项 */
hide?: boolean;
/** 表单的标签(如果是一个string,会用于默认必选规则的消息提示) */
label?: CustomRenderType;
/** 自定义组件内部渲染 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const {
emptyStateValue,
fieldName,
formFieldProps,
hide,
label,
labelClass,
labelWidth,
Expand Down Expand Up @@ -95,7 +96,7 @@ const currentRules = computed(() => {
});

const visible = computed(() => {
return isIf.value && isShow.value;
return !hide && isIf.value && isShow.value;
});

const shouldRequired = computed(() => {
Expand Down Expand Up @@ -283,7 +284,7 @@ onUnmounted(() => {

<template>
<FormField
v-if="isIf"
v-if="!hide && isIf"
v-bind="fieldProps"
v-slot="slotProps"
:name="fieldName"
Expand Down
2 changes: 2 additions & 0 deletions packages/@core/ui-kit/form-ui/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ export interface FormSchema<
fieldName: string;
/** 帮助信息 */
help?: CustomRenderType;
/** 是否隐藏表单项 */
hide?: boolean;
/** 表单项 */
label?: CustomRenderType;
// 自定义组件内部渲染
Expand Down
Loading