mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
docs: Dropdown-translation (#2136)
This commit is contained in:
parent
0869e2959a
commit
1cec962d74
@ -1,10 +1,18 @@
|
||||
---
|
||||
order: 0
|
||||
title: 基本
|
||||
title:
|
||||
zh-CN: 基本
|
||||
en-US: Basic
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
最简单的下拉菜单。
|
||||
|
||||
## en-US
|
||||
|
||||
The most basic dropdown menu.
|
||||
|
||||
````jsx
|
||||
import { Menu, Dropdown, Icon } from 'antd';
|
||||
|
||||
|
@ -1,10 +1,18 @@
|
||||
---
|
||||
order: 4
|
||||
title: 带下拉框的按钮
|
||||
title:
|
||||
zh-CN: 带下拉框的按钮
|
||||
en-US: Button with dropdown menu
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
左边是按钮,右边是额外的相关功能菜单。
|
||||
|
||||
## en-US
|
||||
|
||||
A button is on the left, and a related functional menu is on the right.
|
||||
|
||||
````jsx
|
||||
import { Menu, Dropdown } from 'antd';
|
||||
const DropdownButton = Dropdown.Button;
|
||||
|
@ -1,10 +1,18 @@
|
||||
---
|
||||
order: 3
|
||||
title: 触发事件
|
||||
title:
|
||||
zh-CN: 触发事件
|
||||
en-US: Click event
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
点击菜单项后会触发事件,用户可以通过相应的菜单项 key 进行不同的操作。
|
||||
|
||||
## en-US
|
||||
|
||||
An event will be triggered when you click menu items, in which you can make different operations according to item's key.
|
||||
|
||||
````jsx
|
||||
import { Menu, Dropdown, Icon } from 'antd';
|
||||
const onClick = function ({ key }) {
|
||||
|
@ -1,10 +1,18 @@
|
||||
---
|
||||
order: 1
|
||||
title: 其他元素
|
||||
title:
|
||||
zh-CN: 其他元素
|
||||
en-US: Other elements
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
分割线和不可用菜单项。
|
||||
|
||||
## en-US
|
||||
|
||||
Divider and disabled menu item.
|
||||
|
||||
````jsx
|
||||
import { Menu, Dropdown, Icon } from 'antd';
|
||||
|
||||
|
@ -1,10 +1,18 @@
|
||||
---
|
||||
order: 6
|
||||
title: 菜单隐藏方式
|
||||
title:
|
||||
zh-CN: 菜单隐藏方式
|
||||
en-US: The way of hiding menu.
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
默认是点击关闭菜单,可以关闭此功能。
|
||||
|
||||
## en-US
|
||||
|
||||
The default is to close the menu when you click on menu items, this feature can be turned off.
|
||||
|
||||
````jsx
|
||||
import { Menu, Dropdown, Icon } from 'antd';
|
||||
|
||||
|
@ -1,10 +1,18 @@
|
||||
---
|
||||
order: 5
|
||||
title: 多级菜单
|
||||
title:
|
||||
zh-CN: 多级菜单
|
||||
en-US: Cascading menu
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
传入的菜单里有多个层级。
|
||||
|
||||
## en-US
|
||||
|
||||
The menu has multiple levels.
|
||||
|
||||
````jsx
|
||||
import { Menu, Dropdown, Icon } from 'antd';
|
||||
const SubMenu = Menu.SubMenu;
|
||||
|
@ -1,10 +1,18 @@
|
||||
---
|
||||
order: 2
|
||||
title: 触发方式
|
||||
title:
|
||||
zh-CN: 触发方式
|
||||
en-US: Trigger mode
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
默认是移入触发菜单,可以点击触发。
|
||||
|
||||
## en-US
|
||||
|
||||
The default trigger mode is `hover`, you can change it to `click`.
|
||||
|
||||
````jsx
|
||||
import { Menu, Dropdown, Icon } from 'antd';
|
||||
|
||||
|
41
components/dropdown/index.en-US.md
Normal file
41
components/dropdown/index.en-US.md
Normal file
@ -0,0 +1,41 @@
|
||||
---
|
||||
category: Components
|
||||
type: Views
|
||||
english: Dropdown
|
||||
---
|
||||
|
||||
A dropdown list.
|
||||
|
||||
## When To Use
|
||||
|
||||
If there are too many operations to display, you can wrap them in a `Dropdown`. By clicking/hovering on the trigger, a dropdown menu should appear, which allows you to choose one option and execute relevant actions.
|
||||
|
||||
## API
|
||||
|
||||
### Dropdown
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|--------------|----------------|----------|--------------|
|
||||
| trigger | the trigger mode which can excute the drop-down action | ['click'] or ['hover'] | ['hover'] |
|
||||
| overlay | the dropdown menu | [Menu](/components/menu) | - |
|
||||
| getPopupContainer | to set the container of the dropdown menu. The default is to create a `div` element in `body`, you can reset it to the scrolling area and make a relative reposition. [example](http://codepen.io/anon/pen/xVBOVQ?editors=001) | Function(triggerNode) | () => document.body |
|
||||
| visible | determine whether the dropdown menu is visible | Boolean | - |
|
||||
| onVisibleChange | a callback function takes an argument: `visible`, can be executed when the visible state is changing | Function | - |
|
||||
|
||||
You can get the menu list by `antd.Menu`, and set a callback function `onSelect` for it if you need. The menu items and the dividers are also available, by using `antd.Menu.Item` and `antd.Menu.Divider` respectively.
|
||||
|
||||
> Warning: You must set a unique `key` for `Menu.Item`.
|
||||
|
||||
|
||||
### DropdownButton
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|--------------|----------------|----------|--------------|
|
||||
| type | type of the button, the same as [Button](/components/button) | String | 'default' |
|
||||
| onClick | a callback function, the same as [Button](/components/button), which will be executed when you click the button on the left | Function | - |
|
||||
| trigger | the trigger mode which can excute the drop-down action | ['click'] or ['hover'] | ['hover'] |
|
||||
| overlay | the dropdown menu | [Menu](/components/menu) | - |
|
||||
| visible | determine whether the dropdown menu is visible | Boolean | - |
|
||||
| onVisibleChange | a callback function takes an argument: `visible`, can be executed when the visible state is changing | Function | - |
|
||||
|
||||
|
@ -15,12 +15,12 @@ english: Dropdown
|
||||
|
||||
属性如下
|
||||
|
||||
| 成员 | 说明 | 类型 | 默认值 |
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-------------|------------------|--------------------|--------------|
|
||||
| trigger | 触发下拉的行为 | ['click'] or ['hover'] | ['hover'] |
|
||||
| overlay | 菜单 | [Menu](/components/menu) | - |
|
||||
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](http://codepen.io/anon/pen/xVBOVQ?editors=001) | Function(triggerNode) | () => document.body |
|
||||
| visible | 菜单是否显示 | Bool | 无 |
|
||||
| visible | 菜单是否显示 | Boolean | - |
|
||||
| onVisibleChange | 菜单显示状态改变时调用,参数为 { visible } | Function | - |
|
||||
|
||||
菜单可由 `antd.Menu` 取得,可设置 `onSelect` 回调,菜单还包括菜单项 `antd.Menu.Item`,分割线 `antd.Menu.Divider`。
|
||||
@ -29,11 +29,11 @@ english: Dropdown
|
||||
|
||||
### DropdownButton
|
||||
|
||||
| 成员 | 说明 | 类型 | 默认值 |
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-------------|------------------|--------------------|--------------|
|
||||
| type | 按钮类型,和 [Button](/components/button) 一致 | String | 'default' |
|
||||
| onClick | 点击左侧按钮的回调,和 [Button](/components/button) 一致 | Function | - |
|
||||
| trigger | 触发下拉的行为 | ['click'] or ['hover'] | ['hover'] |
|
||||
| overlay | 菜单 | [Menu](/components/menu) | - |
|
||||
| visible | 菜单是否显示 | Bool | 无 |
|
||||
| visible | 菜单是否显示 | Boolean | - |
|
||||
| onVisibleChange | 菜单显示状态改变时调用,参数为 { visible } | Function | - |
|
Loading…
Reference in New Issue
Block a user