From 9ec30e719f89865497dbb1321be1df906f59f14e Mon Sep 17 00:00:00 2001 From: Snoword <1430750200@qq.com> Date: Mon, 21 Mar 2022 17:32:05 +0800 Subject: [PATCH] fix: fix the bug that the form search function is invalid of the example-dialog page --- .pnpm-debug.log | 20 -------------------- src/components/Search/src/Search.vue | 15 +++++++-------- 2 files changed, 7 insertions(+), 28 deletions(-) delete mode 100644 .pnpm-debug.log diff --git a/.pnpm-debug.log b/.pnpm-debug.log deleted file mode 100644 index 4f43b7b..0000000 --- a/.pnpm-debug.log +++ /dev/null @@ -1,20 +0,0 @@ -{ - "0 debug pnpm:scope": { - "selected": 1 - }, - "1 error pnpm": { - "errno": 1, - "code": "ELIFECYCLE", - "pkgid": "element-plus-admin@3.0.0", - "stage": "clean", - "script": "npx rimraf docs/node_modules && npx rimraf node_modules", - "pkgname": "element-plus-admin", - "err": { - "name": "pnpm", - "message": "element-plus-admin@3.0.0 clean: `npx rimraf docs/node_modules && npx rimraf node_modules`\nExit status 1", - "code": "ELIFECYCLE", - "stack": "pnpm: element-plus-admin@3.0.0 clean: `npx rimraf docs/node_modules && npx rimraf node_modules`\nExit status 1\n at EventEmitter. (C:\\Users\\admin\\AppData\\Roaming\\npm\\pnpm-global\\5\\node_modules\\.pnpm\\registry.npmmirror.com+pnpm@6.25.1\\node_modules\\pnpm\\dist\\pnpm.cjs:104843:20)\n at EventEmitter.emit (events.js:315:20)\n at ChildProcess. (C:\\Users\\admin\\AppData\\Roaming\\npm\\pnpm-global\\5\\node_modules\\.pnpm\\registry.npmmirror.com+pnpm@6.25.1\\node_modules\\pnpm\\dist\\pnpm.cjs:91921:18)\n at ChildProcess.emit (events.js:315:20)\n at maybeClose (internal/child_process.js:1048:16)\n at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)" - } - }, - "2 warn pnpm:global": " Local package.json exists, but node_modules missing, did you mean to install?" -} \ No newline at end of file diff --git a/src/components/Search/src/Search.vue b/src/components/Search/src/Search.vue index b768002..be444b3 100644 --- a/src/components/Search/src/Search.vue +++ b/src/components/Search/src/Search.vue @@ -63,14 +63,13 @@ const newSchema = computed(() => { const { register, elFormRef, methods } = useForm() const search = async () => { - const res = await unref(elFormRef) - ?.validate() - ?.catch(() => {}) - if (res) { - const { getFormData } = methods - const model = await getFormData() - emit('search', model) - } + await unref(elFormRef)?.validate(async (isValid) => { + if (isValid) { + const { getFormData } = methods + const model = await getFormData() + emit('search', model) + } + }) } const reset = async () => {