From 233a467167e2b363098cc7fa63e7f26d1d15507b Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期日, 27 四月 2025 16:23:28 +0800 Subject: [PATCH] 线索任务 --- miniprogram_npm/tdesign-miniprogram/textarea/textarea.js | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/miniprogram_npm/tdesign-miniprogram/textarea/textarea.js b/miniprogram_npm/tdesign-miniprogram/textarea/textarea.js index 6dc87dc..06b26a5 100644 --- a/miniprogram_npm/tdesign-miniprogram/textarea/textarea.js +++ b/miniprogram_npm/tdesign-miniprogram/textarea/textarea.js @@ -31,13 +31,14 @@ }; this.observers = { value(val) { - this.updateCount(val); + this.updateCount(val !== null && val !== void 0 ? val : this.properties.defaultValue); }, }; this.lifetimes = { ready() { - const { value } = this.properties; - this.updateValue(value == null ? '' : value); + var _a; + const { value, defaultValue } = this.properties; + this.updateValue((_a = value !== null && value !== void 0 ? value : defaultValue) !== null && _a !== void 0 ? _a : ''); }, }; this.methods = { @@ -77,9 +78,9 @@ }; }, onInput(event) { - const { value } = event.detail; + const { value, cursor } = event.detail; this.updateValue(value); - this.triggerEvent('change', { value: this.data.value }); + this.triggerEvent('change', { value: this.data.value, cursor }); }, onFocus(event) { this.triggerEvent('focus', Object.assign({}, event.detail)); -- Gitblit v1.9.3