diff --git a/components/_util/vnode.js b/components/_util/vnode.js
index e36d6e822..ba85697ee 100644
--- a/components/_util/vnode.js
+++ b/components/_util/vnode.js
@@ -1,16 +1,15 @@
-import cloneDeep from 'lodash.clonedeep'
export function cloneVNode (vnode, deep) {
const componentOptions = vnode.componentOptions
const data = vnode.data
let listeners = {}
if (componentOptions && componentOptions.listeners) {
- listeners = cloneDeep(componentOptions.listeners)
+ listeners = { ...componentOptions.listeners }
}
let on = {}
if (data && data.on) {
- on = cloneDeep(data.on)
+ on = { ...data.on }
}
const cloned = new vnode.constructor(
@@ -98,11 +97,23 @@ export function isEmptyElement (ele) {
}
export function getClass (ele) {
- return ele.data && (ele.data.class || ele.data.staticClass)
+ let data = {}
+ if (ele.data) {
+ data = ele.data
+ } else if (ele.$vnode && ele.$vnode.data) {
+ data = ele.$vnode.data
+ }
+ return data.class || data.staticClass
}
export function getStyle (ele) {
- return ele.data && (ele.data.style || ele.data.staticStyle)
+ let data = {}
+ if (ele.data) {
+ data = ele.data
+ } else if (ele.$vnode && ele.$vnode.data) {
+ data = ele.$vnode.data
+ }
+ return data.style || data.staticStyle
}
export function filterEmpty (children = []) {
diff --git a/components/dropdown/index.en-US.md b/components/dropdown/index.en-US.md
index a0b0dba82..4c872bd8c 100644
--- a/components/dropdown/index.en-US.md
+++ b/components/dropdown/index.en-US.md
@@ -6,7 +6,7 @@
| -------- | ----------- | ---- | ------- |
| 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) | - |
+| overlay(slot) | the dropdown menu | [Menu](#/us/components/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 | - |
@@ -16,7 +16,7 @@
| --- | --- | --- |
| 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`.
+You should use [Menu](#/us/components/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`.
>
@@ -27,11 +27,11 @@ You should use [Menu](#/components/us/menu/) as `overlay`. The menu items and di
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
| disabled | whether the dropdown menu is disabled | boolean | - |
-| overlay(slot) | the dropdown menu | [Menu](#/components/us/menu) | - |
+| overlay(slot) | the dropdown menu | [Menu](#/us/components/menu) | - |
| placement | placement of pop menu: `bottomLeft` `bottomCenter` `bottomRight` `topLeft` `topCenter` `topRight` | String | `bottomLeft` |
-| size | size of the button, the same as [Button](#/components/us/button) | string | `default` |
+| size | size of the button, the same as [Button](#/us/components/button) | string | `default` |
| trigger | the trigger mode which executes the drop-down action | Array<`click`\|`hover`\|`contextMenu`> | `['hover']` |
-| type | type of the button, the same as [Button](#/components/us/button) | string | `default` |
+| type | type of the button, the same as [Button](#/us/components/button) | string | `default` |
| visible | whether the dropdown menu is visible | boolean | - |
@@ -39,5 +39,5 @@ You should use [Menu](#/components/us/menu/) as `overlay`. The menu items and di
### Dropdown.Button events
| Events Name | Description | Arguments |
| --- | --- | --- |
-| click | a callback function, the same as [Button](#/components/us/button), which will be executed when you click the button on the left | Function |
+| click | a callback function, the same as [Button](#/us/components/button), which will be executed when you click the button on the left | Function |
| visibleChange | a callback function takes an argument: `visible`, is executed when the visible state is changed | Function |
diff --git a/components/dropdown/index.zh-CN.md b/components/dropdown/index.zh-CN.md
index 8f4d3d753..8c4f839ff 100644
--- a/components/dropdown/index.zh-CN.md
+++ b/components/dropdown/index.zh-CN.md
@@ -6,12 +6,12 @@
| --- | --- | --- | --- |
| disabled | 菜单是否禁用 | boolean | - |
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。 | Function(triggerNode) | `() => document.body` |
-| overlay(slot) | 菜单 | [Menu](#/components/cn/menu) | - |
+| overlay(slot) | 菜单 | [Menu](#/cn/components/menu) | - |
| placement | 菜单弹出位置:`bottomLeft` `bottomCenter` `bottomRight` `topLeft` `topCenter` `topRight` | String | `bottomLeft` |
| trigger | 触发下拉的行为 | Array<`click`\|`hover`\|`contextMenu`> | `['hover']` |
| visible(v-model) | 菜单是否显示 | boolean | - |
-`overlay` 菜单使用 [Menu](#/components/cn/menu/),还包括菜单项 `Menu.Item`,分割线 `Menu.Divider`。
+`overlay` 菜单使用 [Menu](#/cn/components/menu/),还包括菜单项 `Menu.Item`,分割线 `Menu.Divider`。
> 注意: Menu.Item 必须设置唯一的 key 属性。
>
@@ -28,15 +28,15 @@
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| disabled | 菜单是否禁用 | boolean | - |
-| overlay(slot) | 菜单 | [Menu](#/components/cn/menu/) | - |
+| overlay(slot) | 菜单 | [Menu](#/cn/components/menu/) | - |
| placement | 菜单弹出位置:`bottomLeft` `bottomCenter` `bottomRight` `topLeft` `topCenter` `topRight` | String | `bottomLeft` |
-| size | 按钮大小,和 [Button](#/components/cn/button/) 一致 | string | 'default' |
+| size | 按钮大小,和 [Button](#/cn/components/button/) 一致 | string | 'default' |
| trigger | 触发下拉的行为 | Array<`click`\|`hover`\|`contextMenu`> | `['hover']` |
-| type | 按钮类型,和 [Button](#/components/cn/button/) 一致 | string | 'default' |
+| type | 按钮类型,和 [Button](#/cn/components/button/) 一致 | string | 'default' |
| visible(v-model) | 菜单是否显示 | boolean | - |
### Dropdown.Button事件
| 事件名称 | 说明 | 回调参数 |
| --- | --- | --- |
-| click | 点击左侧按钮的回调,和 [Button](#/components/cn/button/) 一致 | Function |
+| click | 点击左侧按钮的回调,和 [Button](#/cn/components/button/) 一致 | Function |
| visibleChange | 菜单显示状态改变时调用,参数为 visible | function(visible) |
diff --git a/components/index.js b/components/index.js
index dbc9732f0..f5cb081d8 100644
--- a/components/index.js
+++ b/components/index.js
@@ -59,3 +59,10 @@ export { default as Divider } from './divider'
import Collapse from './collapse'
const CollapsePanel = Collapse.Panel
export { Collapse, CollapsePanel }
+
+import notification from './notification'
+
+const api = {
+ notification,
+}
+export { api }
diff --git a/components/notification/demo/basic.md b/components/notification/demo/basic.md
index e69de29bb..d34fffc6c 100644
--- a/components/notification/demo/basic.md
+++ b/components/notification/demo/basic.md
@@ -0,0 +1,29 @@
+
+
+#### 基本
+最简单的用法,4.5 秒后自动关闭。
+
+
+
+#### Basic
+The simplest usage that close the notification box after 4.5s.
+
+
+```html
+
+ Open the notification box
+
+
+```
+
diff --git a/components/notification/demo/custom-icon.md b/components/notification/demo/custom-icon.md
new file mode 100644
index 000000000..72f59be1c
--- /dev/null
+++ b/components/notification/demo/custom-icon.md
@@ -0,0 +1,30 @@
+
+
+#### 自定义图标
+图标可以被自定义。
+
+
+
+#### Customized Icon
+The icon can be customized to any vue node or (h) => vue node.
+
+
+```html
+
+ Open the notification box
+
+
+```
+
diff --git a/components/notification/demo/custom-style.md b/components/notification/demo/custom-style.md
new file mode 100644
index 000000000..7df909377
--- /dev/null
+++ b/components/notification/demo/custom-style.md
@@ -0,0 +1,33 @@
+
+
+#### 自定义样式
+使用 style 和 className 来定义样式。
+
+
+
+#### Customized style
+The style and className are available to customize Notification.
+
+
+```html
+
+ Open the notification box
+
+
+```
+
diff --git a/components/notification/demo/duration.md b/components/notification/demo/duration.md
new file mode 100644
index 000000000..26d01aab3
--- /dev/null
+++ b/components/notification/demo/duration.md
@@ -0,0 +1,32 @@
+
+
+#### 自动关闭的延时
+自定义通知框自动关闭的延时,默认`4.5s`,取消自动关闭只要将该值设为 `0` 即可。
+
+
+
+#### Duration after which the notification box is closed
+`Duration` can be used to specify how long the notification stays open. After the duration time elapses,
+the notification closes automatically. If not specified, default value is 4.5 seconds. If you set the value to 0,
+the notification box will never close automatically.
+
+
+```html
+
+ Open the notification box
+
+
+```
+
diff --git a/components/notification/demo/index.vue b/components/notification/demo/index.vue
new file mode 100644
index 000000000..c67499a4a
--- /dev/null
+++ b/components/notification/demo/index.vue
@@ -0,0 +1,50 @@
+
diff --git a/components/notification/demo/placement.md b/components/notification/demo/placement.md
new file mode 100644
index 000000000..5779b0388
--- /dev/null
+++ b/components/notification/demo/placement.md
@@ -0,0 +1,48 @@
+
+
+#### 位置
+可以设置通知从右上角、右下角、左下角、左上角弹出。
+
+
+
+#### Placement
+A notification box can pop up from `topRight` or `bottomRight` or `bottomLeft` or `topLeft`.
+
+
+```html
+
+
+
+ Open the notification box
+
+
+
+```
+
diff --git a/components/notification/demo/with-btn.md b/components/notification/demo/with-btn.md
new file mode 100644
index 000000000..ab9b25c68
--- /dev/null
+++ b/components/notification/demo/with-btn.md
@@ -0,0 +1,46 @@
+
+
+#### 基本
+最简单的用法,4.5 秒后自动关闭。
+
+
+
+#### Basic
+The simplest usage that close the notification box after 4.5s.
+
+
+```html
+
+ Open the notification box
+
+
+```
+
diff --git a/components/notification/demo/with-icon.md b/components/notification/demo/with-icon.md
new file mode 100644
index 000000000..74fce01b9
--- /dev/null
+++ b/components/notification/demo/with-icon.md
@@ -0,0 +1,34 @@
+
+
+#### 带有图标的通知提醒框
+通知提醒框左侧有图标。
+
+
+
+#### Notification with icon
+A notification box with a icon at the left side.
+
+
+```html
+
+