diff --git a/components/dropdown/demo/basic.md b/components/dropdown/demo/basic.md index a8a5de06af..1d1c292e8a 100644 --- a/components/dropdown/demo/basic.md +++ b/components/dropdown/demo/basic.md @@ -2,7 +2,7 @@ - order: 0 -点击触发 +最简单的下拉菜单。 --- @@ -10,21 +10,22 @@ var Menu = antd.Menu; var Dropdown = antd.Dropdown; -function onClick(key){ - alert('select ' + key); -} - -var menu = - disabled - 第一个菜单项 +var menu = + + 第一个菜单项 + + + 第二个菜单项 + - 第二个菜单项 + 第三个菜单项 ; - React.render( - - + + , document.getElementById('components-dropdown-demo-basic')); ```` diff --git a/components/dropdown/demo/event.md b/components/dropdown/demo/event.md new file mode 100644 index 0000000000..344aea196b --- /dev/null +++ b/components/dropdown/demo/event.md @@ -0,0 +1,32 @@ +# 基本 + +- order: 1 + +点击菜单项后会触发事件,用户可以通过相应的菜单项 key 进行不同的操作。 + +--- + +````jsx +var Menu = antd.Menu; +var Dropdown = antd.Dropdown; + +function onClick(key){ + alert('选中了菜单' + key); +} + +var menu = + 第一个菜单项 + 第二个菜单项 + 第三个菜单项 + 第四个菜单项 +; + + +React.render( + + + +, document.getElementById('components-dropdown-demo-event')); +```` diff --git a/components/dropdown/demo/hover.md b/components/dropdown/demo/hover.md deleted file mode 100644 index 6115b986ce..0000000000 --- a/components/dropdown/demo/hover.md +++ /dev/null @@ -1,30 +0,0 @@ -# 基本 - -- order: 1 - -鼠标触发 - ---- - -````jsx -var Menu = antd.Menu; -var Dropdown = antd.Dropdown; - -function onClick(key){ - alert('select ' + key); -} - -var menu = - disabled - 第一个菜单项 - - 第二个菜单项 -; - - -React.render( - - - -, document.getElementById('components-dropdown-demo-hover')); -```` diff --git a/components/dropdown/demo/trigger.md b/components/dropdown/demo/trigger.md new file mode 100644 index 0000000000..60ac1bd68d --- /dev/null +++ b/components/dropdown/demo/trigger.md @@ -0,0 +1,38 @@ +# 触发方式 + +- order: 1 + +点击或鼠标移入触发。 + +--- + +````jsx +var Menu = antd.Menu; +var Dropdown = antd.Dropdown; + +var menu = + + 第一个菜单项 + + + 第二个菜单项 + + + 第三个菜单项 +; + +React.render( +
+ + + + + + +
+, document.getElementById('components-dropdown-demo-trigger')); +````