-
-
Notifications
You must be signed in to change notification settings - Fork 49k
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: dropdown support arrow #23869
Merged
Merged
feat: dropdown support arrow #23869
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f31d296
feat: dropdown support arrow prop
4452541
test: update snapshot
4c9dd58
fix: fix dropdown cls names
7ca46f6
test: update snapshot
3823e62
test: update snapshot
c291a8e
doc: update demo
09a5c8c
test: update demo snapshot
e8c152d
demo
82a7d31
fix: snapshot
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
54 changes: 54 additions & 0 deletions
54
components/dropdown/__tests__/__snapshots__/demo.test.js.snap
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
order: 2 | ||
title: | ||
zh-CN: 箭头 | ||
en-US: Arrow | ||
--- | ||
|
||
## zh-CN | ||
|
||
可以展示一个箭头。 | ||
|
||
## en-US | ||
|
||
You could display an arrow. | ||
|
||
```jsx | ||
import { Menu, Dropdown, Button } from 'antd'; | ||
|
||
const menu = ( | ||
<Menu> | ||
<Menu.Item> | ||
<a target="_blank" rel="noopener noreferrer" href="http://www.alipay.com/"> | ||
1st menu item | ||
</a> | ||
</Menu.Item> | ||
<Menu.Item> | ||
<a target="_blank" rel="noopener noreferrer" href="http://www.taobao.com/"> | ||
2nd menu item | ||
</a> | ||
</Menu.Item> | ||
<Menu.Item> | ||
<a target="_blank" rel="noopener noreferrer" href="http://www.tmall.com/"> | ||
3rd menu item | ||
</a> | ||
</Menu.Item> | ||
</Menu> | ||
); | ||
|
||
ReactDOM.render( | ||
<div> | ||
<Dropdown overlay={menu} placement="bottomLeft" arrow> | ||
<Button>bottomLeft</Button> | ||
</Dropdown> | ||
<Dropdown overlay={menu} placement="bottomCenter" arrow> | ||
<Button>bottomCenter</Button> | ||
</Dropdown> | ||
<Dropdown overlay={menu} placement="bottomRight" arrow> | ||
<Button>bottomRight</Button> | ||
</Dropdown> | ||
<br /> | ||
<Dropdown overlay={menu} placement="topLeft" arrow> | ||
<Button>topLeft</Button> | ||
</Dropdown> | ||
<Dropdown overlay={menu} placement="topCenter" arrow> | ||
<Button>topCenter</Button> | ||
</Dropdown> | ||
<Dropdown overlay={menu} placement="topRight" arrow> | ||
<Button>topRight</Button> | ||
</Dropdown> | ||
</div>, | ||
mountNode, | ||
); | ||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个例子把所有的方向都展示一下,顺序放在 placement.md 后面。 |
||
|
||
```css | ||
#components-dropdown-demo-arrow .ant-btn { | ||
margin-right: 8px; | ||
margin-bottom: 8px; | ||
} | ||
.ant-row-rtl #components-dropdown-demo-arrow .ant-btn { | ||
margin-right: 0; | ||
margin-bottom: 8px; | ||
margin-left: 8px; | ||
} | ||
``` |
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
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.