Skip to content

Commit

Permalink
fix: 修复 disabled 逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyair committed Apr 25, 2020
1 parent e9113e7 commit d371b4a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/apis/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const layout = { labelCol: { span: 4 }, wrapperCol: { span: 20 } };
export default () => {
const { formatFieldsValue, onFormatFieldsValue } = YForm.useFormatFieldsValue();

const onFinish = (values: any) => {
const onFinish = values => {
console.log('Success:', values);
};

Expand Down Expand Up @@ -79,7 +79,7 @@ export default () => {
params: { typeName },
} = YForm.useSubmit({ params: { type: 'create' } });

const onFinish = (values: any) => {
const onFinish = values => {
console.log('Success:', values);
};

Expand Down
6 changes: 6 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ nav:
order: 5
---

## 0.5.8

`2020-04-25`

- 修复 `disabled` 覆盖逻辑

## 0.5.7

`2020-04-16`
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"scripts": {
"bootstrap": "lerna bootstrap",
"dev": "dumi dev",
"start": "dumi dev",
"build": "father-build",
"doc:build": "dumi build",
"now-build": "yarn && yarn bootstrap && yarn doc:build",
Expand Down Expand Up @@ -55,7 +55,7 @@
"babel-eslint": "^9.0.0",
"babel-plugin-import": "^1.13.0",
"cross-env": "^6.0.3",
"dumi": "^1.0.14",
"dumi": "^1.0.20",
"enzyme": "^3.11.0",
"eslint": "^6.7.2",
"eslint-config-umi": "^1.6.0",
Expand All @@ -76,7 +76,7 @@
"react-router-dom": "^5.1.2",
"react-test-renderer": "^16.7.0",
"typescript": "^3.7.5",
"umi": "^3.0.18",
"umi": "^3.1.2",
"umi-test": "^1.9.3"
},
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/yform/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "father-doc-yform",
"version": "0.5.7",
"version": "0.5.8",
"description": "自定义表单组件",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down
4 changes: 3 additions & 1 deletion packages/yform/src/YForm/Items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ const Items = (props: YFormItemsProps) => {
} = _plugins;

if (disabled) {
set(_componentProps, 'disabled', mergeDisabled);
if (!('disabled' in _componentProps)) {
set(_componentProps, 'disabled', mergeDisabled);
}
}

let _children = item.children;
Expand Down

1 comment on commit d371b4a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for website ready!

Built with commit d371b4a

https://father-doc-yform-7g5itm1bz.now.sh

Please sign in to comment.