-
-
Notifications
You must be signed in to change notification settings - Fork 187
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: Add prop to disable close button #416
Merged
afc163
merged 6 commits into
react-component:master
from
Ke1sy:feat/disable-close-button
May 28, 2024
+38
−2
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
18884a1
Add prop to disable close button
e6f8250
renamed prop to `disableCloseBtn`
fc6c5c4
Merge branch 'master' into feat/disable-close-button
Ke1sy 4f074bd
removed empty line
Ke1sy f2f6725
added 'disable' to closable
fc6f5b6
readme update
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
原来
typeof
还能当函数调用,学到了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.
是的,
typeof
后面跟着括号的用法在 JavaScript 中是有效的,但这实际上与函数调用不同。当你写typeof(123)
时,括号在这里起到的是分组操作符的作用,而不是表示函数调用。这意味着括号内的表达式会被首先计算,然后typeof
操作符应用于该表达式的结果。这里是一些例子来说明这一点:
在以上例子中,括号的使用并没有改变
typeof
的行为。它们仅仅是在语法上明确了typeof
操作符作用的对象,特别是在表达式较为复杂时,使用括号可以帮助提高代码的可读性。此外,你会注意到无论是使用括号
typeof(123)
还是不使用括号typeof 123
,结果都是相同的。这是因为typeof
后面紧跟着的表达式(无论是否包含在括号中)都会被评估,然后typeof
返回该表达式的类型。因此,即使typeof
可以与括号一起使用,这并不意味着它是以函数的形式被调用。