diff --git a/components/_util/vnode.js b/components/_util/vnode.js
index 3919d75d4..663aa7972 100644
--- a/components/_util/vnode.js
+++ b/components/_util/vnode.js
@@ -45,7 +45,14 @@ export function cloneVNodes (vnodes, deep) {
}
export function cloneElement (n, nodeProps, clone) {
- const node = clone ? cloneVNode(n, true) : n
+ let ele = n
+ if (Array.isArray(n)) {
+ ele = filterEmpty(n)[0]
+ }
+ if (!ele) {
+ return null
+ }
+ const node = clone ? cloneVNode(ele, true) : ele
const { props = {}, key, on = {}} = nodeProps
const data = node.data || {}
const { style = data.style,
@@ -95,6 +102,10 @@ export function filterEmpty (children = []) {
return children.filter(c => c.tag || c.text.trim() !== '')
}
+export function getPropsData (ele) {
+ return ele.componentOptions && ele.componentOptions.propsData
+}
+
export function getEvents (child) {
let events = {}
if (child.componentOptions && child.componentOptions.listeners) {
@@ -102,5 +113,5 @@ export function getEvents (child) {
} else if (child.data && child.data.on) {
events = child.data.on
}
- return events
+ return { ...events }
}
diff --git a/components/button/button-group.vue b/components/button/button-group.vue
index aab6839e8..a69df4bf9 100644
--- a/components/button/button-group.vue
+++ b/components/button/button-group.vue
@@ -1,18 +1,20 @@
+```
diff --git a/components/dropdown/demo/event.md b/components/dropdown/demo/event.md
new file mode 100644
index 000000000..ec2961af9
--- /dev/null
+++ b/components/dropdown/demo/event.md
@@ -0,0 +1,34 @@
+
+#### 触发事件
+点击菜单项后会触发事件,用户可以通过相应的菜单项 key 进行不同的操作。
+
+
+
+#### Click event
+An event will be triggered when you click menu items, in which you can make different operations according to item's key.
+
+
+```html
+
+
+
+ Hover me, Click menu item
+
+
+ 1st menu item
+ 2nd menu item
+ 3rd menu item
+
+
+
+
+
+```
diff --git a/components/dropdown/demo/index.vue b/components/dropdown/demo/index.vue
new file mode 100644
index 000000000..0ea3c7fa3
--- /dev/null
+++ b/components/dropdown/demo/index.vue
@@ -0,0 +1,46 @@
+
diff --git a/components/dropdown/demo/item.md b/components/dropdown/demo/item.md
new file mode 100644
index 000000000..17d3de0c8
--- /dev/null
+++ b/components/dropdown/demo/item.md
@@ -0,0 +1,29 @@
+
+#### 其他元素
+分割线和不可用菜单项。
+
+
+
+#### Other elements
+Divider and disabled menu item.
+
+
+```html
+
+
+
+ Hover me
+
+
+
+ 1st menu item
+
+
+ 2nd menu item
+
+
+ 3rd menu item(disabled)
+
+
+
+```
diff --git a/components/dropdown/demo/overlay-visible.md b/components/dropdown/demo/overlay-visible.md
new file mode 100644
index 000000000..b15970888
--- /dev/null
+++ b/components/dropdown/demo/overlay-visible.md
@@ -0,0 +1,41 @@
+
+#### 菜单隐藏方式
+默认是点击关闭菜单,可以关闭此功能。
+
+
+
+#### The way of hiding menu.
+The default is to close the menu when you click on menu items, this feature can be turned off.
+
+
+```html
+
+
+
+ Hover me
+
+
+ Clicking me will not close the menu.
+ Clicking me will not close the menu also.
+ Clicking me will close the menu
+
+
+
+
+
+```
diff --git a/components/dropdown/demo/placement.md b/components/dropdown/demo/placement.md
new file mode 100644
index 000000000..2edf090af
--- /dev/null
+++ b/components/dropdown/demo/placement.md
@@ -0,0 +1,49 @@
+
+#### 弹出位置
+支持 6 个弹出位置。
+
+
+
+#### Placement
+Support 6 placements.
+
+
+```html
+
+
+
+
+
+
+```
diff --git a/components/dropdown/demo/sub-menu.md b/components/dropdown/demo/sub-menu.md
new file mode 100644
index 000000000..92e2ae27c
--- /dev/null
+++ b/components/dropdown/demo/sub-menu.md
@@ -0,0 +1,31 @@
+
+#### 多级菜单
+传入的菜单里有多个层级。
+
+
+
+#### Cascading menu
+The menu has multiple levels.
+
+
+```html
+
+
+
+ Cascading menu
+
+
+ 1st menu item
+ 2nd menu item
+
+ 3rd menu item
+ 4th menu item
+
+
+ 5d menu item
+ 6th menu item
+
+
+
+
+```
diff --git a/components/dropdown/demo/trigger.md b/components/dropdown/demo/trigger.md
new file mode 100644
index 000000000..e68ae5bf5
--- /dev/null
+++ b/components/dropdown/demo/trigger.md
@@ -0,0 +1,29 @@
+
+#### 触发方式
+默认是移入触发菜单,可以点击触发。
+
+
+
+#### Trigger mode
+The default trigger mode is `hover`, you can change it to `click`.
+
+
+```html
+
+
+
+ Click me
+
+
+
+ 1st menu item
+
+
+ 2nd menu item
+
+
+ 3rd menu item
+
+
+
+```
diff --git a/components/dropdown/dropdown-button.vue b/components/dropdown/dropdown-button.vue
new file mode 100644
index 000000000..f36871bd6
--- /dev/null
+++ b/components/dropdown/dropdown-button.vue
@@ -0,0 +1,81 @@
+
diff --git a/components/dropdown/dropdown.vue b/components/dropdown/dropdown.vue
new file mode 100644
index 000000000..04d5524bc
--- /dev/null
+++ b/components/dropdown/dropdown.vue
@@ -0,0 +1,76 @@
+
diff --git a/components/dropdown/getDropdownProps.js b/components/dropdown/getDropdownProps.js
new file mode 100644
index 000000000..93b0391e9
--- /dev/null
+++ b/components/dropdown/getDropdownProps.js
@@ -0,0 +1,13 @@
+import PropTypes from '../_util/vue-types'
+export default () => ({
+ trigger: PropTypes.array.def(['hover']),
+ overlay: PropTypes.any,
+ visible: PropTypes.bool,
+ disabled: PropTypes.bool,
+ align: PropTypes.object,
+ getPopupContainer: PropTypes.func,
+ prefixCls: PropTypes.string,
+ transitionName: PropTypes.string,
+ placement: PropTypes.oneOf(['topLeft', 'topCenter', 'topRight', 'bottomLeft', 'bottomCenter', 'bottomRight']),
+ forceRender: PropTypes.bool,
+})
diff --git a/components/dropdown/index.en-US.md b/components/dropdown/index.en-US.md
new file mode 100644
index 000000000..a0b0dba82
--- /dev/null
+++ b/components/dropdown/index.en-US.md
@@ -0,0 +1,43 @@
+## API
+
+### Dropdown
+
+| Property | Description | Type | Default |
+| -------- | ----------- | ---- | ------- |
+| disabled | whether the dropdown menu is disabled | boolean | - |
+| 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](https://codepen.io/afc163/pen/zEjNOy?editors=0010) | Function(triggerNode) | `() => document.body` |
+| overlay(slot) | the dropdown menu | [Menu](#/components/us/menu) | - |
+| placement | placement of pop menu: `bottomLeft` `bottomCenter` `bottomRight` `topLeft` `topCenter` `topRight` | String | `bottomLeft` |
+| trigger | the trigger mode which executes the drop-down action | Array<`click`\|`hover`\|`contextMenu`> | `['hover']` |
+| visible(v-model) | whether the dropdown menu is visible | boolean | - |
+
+### events
+| Events Name | Description | Arguments |
+| --- | --- | --- |
+| visibleChange | a callback function takes an argument: `visible`, is executed when the visible state is changed | function(visible) |
+
+You should use [Menu](#/components/us/menu/) as `overlay`. The menu items and dividers are also available by using `Menu.Item` and `Menu.Divider`.
+
+> Warning: You must set a unique `key` for `Menu.Item`.
+>
+> Menu of Dropdown is unselectable by default, you can make it selectable via `