From b5bd331f67a8a3a812fcf6b77d14069d35401382 Mon Sep 17 00:00:00 2001 From: teukkk Date: Wed, 13 Nov 2024 18:18:36 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=8C=BA=E5=88=86=E5=90=8C?= =?UTF-8?q?=E6=97=B6=E6=9C=89=E4=B8=A4=E4=B8=AAMsTreeSelect=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/pure/ms-tree-select/index.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/pure/ms-tree-select/index.vue b/frontend/src/components/pure/ms-tree-select/index.vue index ba0bb3fa3e..5b71bf6315 100644 --- a/frontend/src/components/pure/ms-tree-select/index.vue +++ b/frontend/src/components/pure/ms-tree-select/index.vue @@ -15,7 +15,6 @@ :content-style="{ width: `${triggerWidth}px` }" > >('modelValue', { required: true, default: [] }); @@ -248,7 +246,7 @@ const triggerWidth = ref(280); // 下拉框的宽度 function updateTriggerWidth() { - const treeSelectInput = document.getElementById(treeSelectId.value) as HTMLElement; + const treeSelectInput = treeSelectRef.value?.$el.nextElementSibling as HTMLElement; if (treeSelectInput) { triggerWidth.value = treeSelectInput.offsetWidth; // 设置成输入框的宽度 }