From 8148f629de293dd23ff401118cf67cfe0108d5fc Mon Sep 17 00:00:00 2001 From: modendeveloper Date: Tue, 25 Feb 2025 23:55:37 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A3282=20=E3=80=90=E7=A4=BC=E5=93=81?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E3=80=91=E9=80=81=E7=A4=BC=E5=8C=85=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2-=E9=80=81=E7=A4=BC=E5=AF=84=E8=AF=AD=E6=9C=AA?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=97=E6=95=B0=E9=99=90=E5=88=B6=EF=BC=8C?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BC=98=E5=8C=96=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg_user/views/gift/gift.vue | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg_user/views/gift/gift.vue b/pkg_user/views/gift/gift.vue index 18f0f44..95508a0 100644 --- a/pkg_user/views/gift/gift.vue +++ b/pkg_user/views/gift/gift.vue @@ -30,7 +30,9 @@ maxlength="30" border="none" count + ref="textarea" cols="30" + @input="messageChange" rows="10"> @@ -190,7 +192,18 @@ export default { imageUrl: this.giftImage } }, + onReady() { + this.$nextTick(() => { + this.$refs.textarea.setFormatter(val => { + return val.length > 30 ? val.substring(0, 30) : val + }) + }) + }, methods: { + messageChange(e) { + console.log(e); + this.message = e.substring(0, 30) + }, numberChange(e) { this.computedPrice(e.value) },