-
-
Notifications
You must be signed in to change notification settings - Fork 47.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Modal.confirm add maskClosable option (#4488) #4490
Conversation
@pixystone, thanks for your PR! By analyzing the history of the files in this pull request, we identified @Dafrok, @afc163 and @GrayChoi to be potential reviewers. |
@@ -21,6 +21,7 @@ function showConfirm() { | |||
confirm({ | |||
title: 'Want to delete these items?', | |||
content: 'some descriptions', | |||
maskClosable: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
例子中可以不加。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不太清楚test case哪里加
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -16,6 +16,9 @@ export default function confirm(config) { | |||
let width = props.width || 416; | |||
let style = props.style || {}; | |||
|
|||
// 默认为 false,保持旧版默认行为 | |||
let maskClosable = ('maskClosable' in props) && props.maskClosable || false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let => const
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用 ? :
三目运算符可读性会更好一点。
好快,给力。:+1: |
👍 按 review 的改完,就可以合并了。 |
@@ -16,6 +16,9 @@ export default function confirm(config) { | |||
let width = props.width || 416; | |||
let style = props.style || {}; | |||
|
|||
// 默认为 false,保持旧版默认行为 | |||
const maskClosable = props.maskClosable === undefined ? false : props.maskClosable; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该用 defaultProps 吧。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
方法调用没有 defaultProps 的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
奥,这个是方法,那写到上面的 assgin
里跟 iconType
一起好点?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还需要改么?这里我先跟width和style上面的保持一致,下面还有一些okCancel之类的配置其实也不是很明显
👍 |
close #4488