This commit is contained in:
dap
2024-10-19 21:29:20 +08:00
105 changed files with 1512 additions and 1559 deletions

View File

@@ -44,7 +44,7 @@ const withDefaultPlaceholder = <T extends Component>(
type: 'input' | 'select',
) => {
return (props: any, { attrs, slots }: Omit<SetupContext, 'expose'>) => {
const placeholder = props?.placeholder || $t(`placeholder.${type}`);
const placeholder = props?.placeholder || $t(`ui.placeholder.${type}`);
return h(component, { ...props, ...attrs, placeholder }, slots);
};
};

View File

@@ -28,7 +28,7 @@ setupVbenForm<ComponentType>({
// 输入项目必填国际化适配
required: (value, _params, ctx) => {
if (value === undefined || value === null || value.length === 0) {
return $t('formRules.required', [ctx.label]);
return $t('ui.formRules.required', [ctx.label]);
}
return true;
},
@@ -38,7 +38,7 @@ setupVbenForm<ComponentType>({
[false, null, undefined].includes(value) ||
(isArray(value) && value.length === 0)
) {
return $t('formRules.selectRequired', [ctx.label]);
return $t('ui.formRules.selectRequired', [ctx.label]);
}
return true;
},