fix: form label and control style (#5580)

* fix: form label and control style

* fix: empty label mark with required rules
This commit is contained in:
Netfan
2025-02-21 11:14:59 +08:00
committed by GitHub
parent 5aff8bac10
commit c9ccd2bbab
3 changed files with 11 additions and 4 deletions

View File

@@ -235,7 +235,9 @@ const [BaseForm, baseFormApi] = useVbenForm({
default: () => ['我已阅读并同意'],
};
},
rules: z.any().refine((v) => v, { message: '为什么不同意?勾上它!' }),
rules: z
.boolean()
.refine((v) => v, { message: '为什么不同意?勾上它!' }),
},
{
component: 'Mentions',
@@ -266,7 +268,8 @@ const [BaseForm, baseFormApi] = useVbenForm({
class: 'w-auto',
},
fieldName: 'switch',
help: () => ['这是一个帮助信息', '第二行'].map((v) => h('p', () => v)),
help: () =>
['这是一个多行帮助信息', '第二行', '第三行'].map((v) => h('p', v)),
label: '开关',
},
{