diff --git a/src/types/element-plus.d.ts b/src/types/element-plus.d.ts new file mode 100644 index 0000000..4a6f670 --- /dev/null +++ b/src/types/element-plus.d.ts @@ -0,0 +1,5 @@ +import type { FormValidateCallback, FormValidationResult } from 'element-plus'; + +interface IForm { + validate: (callback?: FormValidateCallback | undefined) => FormValidationResult; +} diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 52db39f..ff3621f 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -62,13 +62,10 @@ import { validUsername } from '@/utils/validate'; import { defineComponent } from 'vue'; import SocialSign from './components/SocialSignin.vue'; -import type { FormItemRule, FormValidateCallback, FormValidationResult } from 'element-plus'; +import type { FormItemRule } from 'element-plus'; +import type { IForm } from '@/types/element-plus'; import store from '@/store'; -interface IForm { - validate: (callback?: FormValidateCallback | undefined) => FormValidationResult; -} - export default defineComponent({ name: 'Login', components: { SocialSign },