From 7401ef7941b7fa29b95203d5c796f9a269768120 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Wed, 28 Jun 2023 08:38:26 +0800 Subject: [PATCH] fix validator --- src/@validators/index.ts | 4 ++++ src/pages/login.vue | 14 ++++++++------ tsconfig.json | 8 +++++++- 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 src/@validators/index.ts diff --git a/src/@validators/index.ts b/src/@validators/index.ts new file mode 100644 index 00000000..9c476b04 --- /dev/null +++ b/src/@validators/index.ts @@ -0,0 +1,4 @@ +import { ValidationRule } from 'vuetify/types/services/validation' + +// 必输校验 +export const requiredValidator: ValidationRule = (value: any) => !!value || '此项为必填项' diff --git a/src/pages/login.vue b/src/pages/login.vue index dd40d643..d7804a9c 100644 --- a/src/pages/login.vue +++ b/src/pages/login.vue @@ -1,7 +1,9 @@