From bab852804ba2aa1dc23385e62f6873ccdbd73ccf Mon Sep 17 00:00:00 2001 From: Tevin <tingquanren@163.com> Date: Sun, 17 Jul 2022 10:23:55 +0800 Subject: [PATCH] 优化文件存储服务,提供列队批量操作 --- forms/input/CInput.vue | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/forms/input/CInput.vue b/forms/input/CInput.vue index 74d986e..d23c616 100644 --- a/forms/input/CInput.vue +++ b/forms/input/CInput.vue @@ -6,7 +6,7 @@ <template> <view class="c-input" - :class="unit?'c-input-unit':''" + :class="[unit?'c-input-unit':'', readOnly ? 'read-only':'']" > <AtInput :name="itemRes.name" @@ -46,10 +46,15 @@ placeholder: String, // 输入框单位 unit: String, + // 只读模式 + readOnly: { + type: Boolean, + default: false, + }, }, computed: { value() { - return (this.itemRes.formData[this.itemRes.name] || '').replace( + return ((this.itemRes.formData[this.itemRes.name] || '') + '').replace( /[\n\r]/g, '' ); @@ -58,7 +63,7 @@ methods: { hanldeChange(evt) { // 小程序中,可以粘贴换行符进来 - const changeValue = (evt || '').replace(/[\n\r]/g, ''); + const changeValue = ((evt || '') + '').replace(/[\n\r]/g, ''); this.itemRes.onChange(changeValue); }, }, -- Gitblit v1.9.1