From fd1582c5b5bd07df12d2cadf2d0309ed8ce22afd Mon Sep 17 00:00:00 2001 From: 梁灏 Date: Mon, 6 Mar 2017 13:31:48 +0800 Subject: [PATCH] support Menu & Layout --- CHANGE.md | 5 ++++- README.md | 4 ++-- examples/app.vue | 1 + examples/main.js | 4 ++++ examples/routers/menu.vue | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------- src/components/menu/menu-item.vue | 28 ++++++++++++++++++++++++++-- src/components/menu/menu.vue | 88 ++++++++++++++++++++++++++++++++++------------------------------------------------------ src/components/menu/submenu.vue | 42 +++++++++++++++++++++++++++--------------- src/components/select/dropdown.vue | 1 + src/index.js | 10 +++++----- 10 files changed, 284 insertions(+), 118 deletions(-) diff --git a/CHANGE.md b/CHANGE.md index ab869d7..6f5d756 100644 --- a/CHANGE.md +++ b/CHANGE.md @@ -35,4 +35,7 @@ class 改为了 className 支持 v-model ### Dropdown DropdownItem key 改为 name, Dropdown 的 visible 要使用 @on-visible-change 捕获,不再 sync -DropdownItem 里,this.$parent.$parent 与1.0 有区别 \ No newline at end of file +DropdownItem 里,this.$parent.$parent 与1.0 有区别 +### Menu +MenuItem 和 Submenu 的 key 改为了 name +Menu 的 activeKey 改为 activeName,openKeys 改为 openNames \ No newline at end of file diff --git a/README.md b/README.md index dd61e87..34f796f 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ ## Programming - [x] Grid -- [ ] Layout +- [x] Layout - [x] Button - [x] Icon - [x] Input @@ -49,7 +49,7 @@ - [x] Poptip - [x] Carousel - [x] Tree -- [ ] Menu +- [x] Menu - [x] Tabs - [x] Dropdown - [ ] Page diff --git a/examples/app.vue b/examples/app.vue index 283fa18..6dc68d2 100644 --- a/examples/app.vue +++ b/examples/app.vue @@ -40,6 +40,7 @@ li + li { border-left: solid 1px #bbb; padding-left: 10px; margin-left: 10px; }
  • Slider
  • Dropdown
  • Breadcrumb
  • +
  • Menu
  • diff --git a/examples/main.js b/examples/main.js index edcc532..dddd09c 100644 --- a/examples/main.js +++ b/examples/main.js @@ -124,6 +124,10 @@ const router = new VueRouter({ { path: '/breadcrumb', component: require('./routers/breadcrumb.vue') + }, + { + path: '/menu', + component: require('./routers/menu.vue') } ] }); diff --git a/examples/routers/menu.vue b/examples/routers/menu.vue index c28b2bf..dfbfec5 100644 --- a/examples/routers/menu.vue +++ b/examples/routers/menu.vue @@ -1,48 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/menu/menu.vue b/src/components/menu/menu.vue index 95919cb..8bb0263 100644 --- a/src/components/menu/menu.vue +++ b/src/components/menu/menu.vue @@ -3,10 +3,13 @@ diff --git a/src/components/select/dropdown.vue b/src/components/select/dropdown.vue index f4f32bd..1bab5e0 100644 --- a/src/components/select/dropdown.vue +++ b/src/components/select/dropdown.vue @@ -6,6 +6,7 @@ import Popper from 'popper.js'; export default { + name: 'Drop', props: { placement: { type: String, diff --git a/src/index.js b/src/index.js index 5aa84e8..f7050ca 100644 --- a/src/index.js +++ b/src/index.js @@ -20,7 +20,7 @@ import Icon from './components/icon'; import Input from './components/input'; import InputNumber from './components/input-number'; // import LoadingBar from './components/loading-bar'; -// import Menu from './components/menu'; +import Menu from './components/menu'; // import Message from './components/message'; // import Modal from './components/modal'; // import Notice from './components/notice'; @@ -76,10 +76,10 @@ const iview = { Input, InputNumber, // LoadingBar, - // Menu, - // MenuGroup: Menu.Group, - // MenuItem: Menu.Item, - // Submenu: Menu.Sub, + Menu, + MenuGroup: Menu.Group, + MenuItem: Menu.Item, + Submenu: Menu.Sub, // Message, // Modal, // Notice, -- libgit2 0.21.4