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; // 设置成输入框的宽度 }