Commit 6936adb2c2af3c0bfbd238be1d61933601ff2b88
1 parent
21a225c2
fix(form): fix the form item setting not taking effect
Showing
2 changed files
with
4 additions
and
2 deletions
CHANGELOG.zh_CN.md
@@ -17,6 +17,7 @@ | @@ -17,6 +17,7 @@ | ||
17 | - 修复升级之后 table 类型问题 | 17 | - 修复升级之后 table 类型问题 |
18 | - 修复分割菜单且左侧菜单没有数据时候,继续展示上一次子菜单的问题 | 18 | - 修复分割菜单且左侧菜单没有数据时候,继续展示上一次子菜单的问题 |
19 | - 修复`useMessage`类型问题 | 19 | - 修复`useMessage`类型问题 |
20 | +- 修复表单项设置`disabled`不生效问题 | ||
20 | 21 | ||
21 | ## 2.0.0-rc.8 (2020-11-2) | 22 | ## 2.0.0-rc.8 (2020-11-2) |
22 | 23 |
src/components/Form/src/FormItem.tsx
@@ -56,8 +56,9 @@ export default defineComponent({ | @@ -56,8 +56,9 @@ export default defineComponent({ | ||
56 | 56 | ||
57 | const getDisableRef = computed(() => { | 57 | const getDisableRef = computed(() => { |
58 | const { disabled: globDisabled } = props.formProps; | 58 | const { disabled: globDisabled } = props.formProps; |
59 | - const { dynamicDisabled } = props.schema; | ||
60 | - let disabled = !!globDisabled; | 59 | + const { dynamicDisabled, componentProps = {} } = props.schema; |
60 | + const { disabled: itemDisabled = false } = componentProps; | ||
61 | + let disabled = !!globDisabled || itemDisabled; | ||
61 | if (isBoolean(dynamicDisabled)) { | 62 | if (isBoolean(dynamicDisabled)) { |
62 | disabled = dynamicDisabled; | 63 | disabled = dynamicDisabled; |
63 | } | 64 | } |