fix: 修复useValidator报错

This commit is contained in:
kailong321200875 2023-08-16 16:47:19 +08:00
parent 13c9300af2
commit 4912f6c058
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ export const useValidator = () => {
const notSpace = (message?: string): FormItemRule => {
return {
validator: (_, val, callback) => {
if (val.indexOf(' ') !== -1) {
if (val?.indexOf(' ') !== -1) {
callback(new Error(message || t('common.notSpace')))
} else {
callback()