From 74ec45a45856e6a12f8ef0aa69ce63adccae7302 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 14 Oct 2021 14:41:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=8B=E6=8B=89=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E5=AE=BD=E5=BA=A6=E6=97=A0=E9=99=90=E5=AE=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/widget/DeWidget/DeSelect.vue | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/widget/DeWidget/DeSelect.vue b/frontend/src/components/widget/DeWidget/DeSelect.vue index 2c8470b6b6..602711bbaa 100644 --- a/frontend/src/components/widget/DeWidget/DeSelect.vue +++ b/frontend/src/components/widget/DeWidget/DeSelect.vue @@ -10,13 +10,17 @@ :placeholder="$t(options.attrs.placeholder)" :popper-append-to-body="inScreen" @change="changeValue" + @focus="setOptionWidth" > + > + {{ item[options.attrs.label] }} + @@ -43,7 +47,8 @@ export default { data() { return { options: null, - showNumber: false + showNumber: false, + selectOptionWidth: 0 } }, computed: { @@ -119,6 +124,12 @@ export default { text: item } }) + }, + setOptionWidth(event) { + // 下拉框弹出时,设置弹框的宽度 + this.$nextTick(() => { + this.selectOptionWidth = event.srcElement.offsetWidth + 'px' + }) } }