From fc4bb323310a3703f63a248a934c7f04d286afee Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 3 Jun 2021 18:49:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/widget/DeWidget/DeSelect.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/widget/DeWidget/DeSelect.vue b/frontend/src/components/widget/DeWidget/DeSelect.vue index b3b131cdf9..267f116da4 100644 --- a/frontend/src/components/widget/DeWidget/DeSelect.vue +++ b/frontend/src/components/widget/DeWidget/DeSelect.vue @@ -69,13 +69,17 @@ export default { changeValue(value) { this.setCondition() // this.inDraw && this.$emit('set-condition-value', { component: this.element, value: [value], operator: this.operator }) + this.showNumber = false this.$nextTick(() => { + if (!this.$refs.deSelect.$refs.tags || !this.options.attrs.multiple) { + return + } const kids = this.$refs.deSelect.$refs.tags.children[0].children let contentWidth = 0 kids.forEach(kid => { contentWidth += kid.offsetWidth }) - this.showNumber = contentWidth > (this.$refs.deSelect.$refs.tags.clientWidth * 0.7) + this.showNumber = contentWidth > (this.$refs.deSelect.$refs.tags.clientWidth * 0.9) }) },