From 500f7dc7482ec85a73ff5229f2fc1316bd4bc591 Mon Sep 17 00:00:00 2001 From: Tevin <tingquanren@163.com> Date: Sun, 24 Apr 2022 10:38:58 +0800 Subject: [PATCH] 调整在线测试图片地址 --- forms/input/CInput.vue | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/forms/input/CInput.vue b/forms/input/CInput.vue index 95f98ff..ca251f7 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,14 +46,23 @@ placeholder: String, // 输入框单位 unit: String, + // 只读模式 + readOnly: { + type: Boolean, + default: false, + }, }, computed: { value() { - return (itemRes.formData[itemRes.name] || '').replace(/[\n\r]/g, ''); + return (this.itemRes.formData[this.itemRes.name] || '').replace( + /[\n\r]/g, + '' + ); }, }, methods: { hanldeChange(evt) { + // 小程序中,可以粘贴换行符进来 const changeValue = (evt || '').replace(/[\n\r]/g, ''); this.itemRes.onChange(changeValue); }, -- Gitblit v1.9.1