From 3b03f87a02458f719e2eb4bf112a13441b427d14 Mon Sep 17 00:00:00 2001 From: ‘chensiAb’ <‘chenchenco03@163.com’> Date: Tue, 25 Mar 2025 13:54:34 +0800 Subject: [PATCH] Merge branch 'master' of ssh://dev.zhiheiot.com:29418/mob-components --- forms/input/CInput.vue | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/forms/input/CInput.vue b/forms/input/CInput.vue index 7c8d604..d20866e 100644 --- a/forms/input/CInput.vue +++ b/forms/input/CInput.vue @@ -1,12 +1,14 @@ /** * CInput - 表单项,文本输入框 + * 用于在表单中收集用户的文本输入 + * 支持多种输入类型,可以设置占位提示文本,并且支持显示单位标识 * @author Tevin */ <template> <view class="c-input" - :class="[unit?'c-input-unit':'', readOnly ? 'read-only':'']" + :class="[unit?'c-input-unit':'', readOnly?'read-only':'']" > <AtInput :name="itemRes.name" @@ -16,8 +18,9 @@ :required="itemRes.required" :error="itemRes.error" :cursorSpacing="0" + :cursor="-1" :value="value" - :onChange="evt => hanldeChange(evt)" + :onChange="evt => handleChange(evt)" > <slot v-if="!unit" /> <text @@ -56,12 +59,12 @@ value() { return ((this.itemRes.formData[this.itemRes.name] || '') + '').replace( /[\n\r]/g, - '' + '', ); }, }, methods: { - hanldeChange(evt) { + handleChange(evt) { // 去除首尾空格,小程序中还可以粘贴换行符进来 const changeValue = ((evt || '') + '') .replace(/^\s+|\s+$/g, '') -- Gitblit v1.9.1