From 215fcb8306751fe9325ee54621836a1ac5c573ec Mon Sep 17 00:00:00 2001 From: sifan <718662552@qq.com> Date: Mon, 19 Jul 2021 16:54:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Ddisabled=E3=80=81reado?= =?UTF-8?q?nly=E3=80=81clearable=20=E9=83=A8=E5=88=86=E6=83=85=E5=86=B5?= =?UTF-8?q?=E4=B8=8B=E4=B8=8D=E7=94=9F=E6=95=88=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/form-engine.vue | 30 +++++++++++++++++++++--------- vetur/attributes.json | 4 ++++ vetur/tags.json | 2 +- 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 8d6f965..52b3d9d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "v-form-engine", - "version": "1.2.3", + "version": "1.2.4", "description": "一个基于 vue + element-ui 的 PC 端表单引擎。支持灵活的配置项、编辑/查看两种视图、自定义模板/插槽、溢出隐藏、双击复制等...", "typings": "dist/index.d.ts", "main": "dist/v-form-engine.js", diff --git a/src/form-engine.vue b/src/form-engine.vue index bd96e12..660a504 100644 --- a/src/form-engine.vue +++ b/src/form-engine.vue @@ -46,9 +46,21 @@ :is="getComponentName(item.type)" :placeholder="getPlaceholder(item)" :type="item.type" - :clearable="item.clearable || clearable" - :disabled="item.disabled || disabled" - :readonly="item.readonly" + :clearable="getAttrValue( + getAttrValue(item, 'component-props', item), + 'clearable', + getAttrValue(item, 'clearable', clearable) + )" + :disabled="getAttrValue( + getAttrValue(item, 'component-props', item), + 'disabled', + getAttrValue(item, 'disabled', disabled) + )" + :readonly="getAttrValue( + getAttrValue(item, 'component-props', item), + 'readonly', + getAttrValue(item, 'readonly', readonly) + )" >