From 311b25aa48705de8cb5b8a471cf136b41c5111d9 Mon Sep 17 00:00:00 2001 From: wangyilin <1454641981@qq.com> Date: Fri, 3 Jan 2025 11:44:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=8A=E4=BC=A0=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E4=B8=A4=E5=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/upload/SingleImageFileUpload.vue | 12 ++++++------ securityManagement/src/views/enterprise.vue | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/securityManagement/src/components/upload/SingleImageFileUpload.vue b/securityManagement/src/components/upload/SingleImageFileUpload.vue index 8ef6733..9183f51 100644 --- a/securityManagement/src/components/upload/SingleImageFileUpload.vue +++ b/securityManagement/src/components/upload/SingleImageFileUpload.vue @@ -9,7 +9,7 @@ /> {{ btnLabel }} - + @@ -34,7 +34,7 @@ const props = withDefaults( width?: string | number; height?: string | number; btnLabel?: string; - id: string; + idFile?: string | any; }>(), { parentDir: "", @@ -43,7 +43,7 @@ const props = withDefaults( width: "150px", height: "150px", btnLabel: "选择图片", - id: "myFileInput", + idFile: "myFileInput", } ); @@ -54,7 +54,7 @@ const uploadUrl = ref(); const fileInput = ref(null); const selectFile = () => { - document.getElementById(props.id)?.click(); + document.getElementById(props.idFile)?.click(); }; async function inputFileListener(this: HTMLInputElement) { @@ -107,13 +107,13 @@ const fileDelete = () => { }; onMounted(() => { document - .getElementById(props.id) + .getElementById(props.idFile) ?.addEventListener("change", inputFileListener); }); onUnmounted(() => { document - .getElementById(props.id) + .getElementById(props.idFile) ?.removeEventListener("change", inputFileListener); }); defineExpose({ fileDelete }); diff --git a/securityManagement/src/views/enterprise.vue b/securityManagement/src/views/enterprise.vue index 39ca3a7..3eedc2a 100644 --- a/securityManagement/src/views/enterprise.vue +++ b/securityManagement/src/views/enterprise.vue @@ -61,7 +61,7 @@
注:自行招用单位备案证或保安许可证