diff --git a/src/components/mew-menu-group/index.js b/src/components/mew-menu-group/index.js new file mode 100644 index 0000000..0a971b8 --- /dev/null +++ b/src/components/mew-menu-group/index.js @@ -0,0 +1,3 @@ +import MenuGroup from '../mew-menu/menu-group.vue'; + +export default MenuGroup; \ No newline at end of file diff --git a/src/components/mew-menu-item/index.js b/src/components/mew-menu-item/index.js new file mode 100644 index 0000000..daa650d --- /dev/null +++ b/src/components/mew-menu-item/index.js @@ -0,0 +1,3 @@ +import MenuItem from '../mew-menu/menu-item.vue'; + +export default MenuItem; \ No newline at end of file diff --git a/src/components/mew-menu/index.js b/src/components/mew-menu/index.js new file mode 100644 index 0000000..b5cd748 --- /dev/null +++ b/src/components/mew-menu/index.js @@ -0,0 +1,10 @@ +import Menu from './menu.vue'; +import MenuGroup from './menu-group.vue'; +import MenuItem from './menu-item.vue'; +import Submenu from './submenu.vue'; + +Menu.Group = MenuGroup; +Menu.Item = MenuItem; +Menu.Sub = Submenu; + +export default Menu; \ No newline at end of file diff --git a/src/components/mew-menu/menu-group.vue b/src/components/mew-menu/menu-group.vue new file mode 100644 index 0000000..5037006 --- /dev/null +++ b/src/components/mew-menu/menu-group.vue @@ -0,0 +1,33 @@ + + diff --git a/src/components/mew-menu/menu-item.vue b/src/components/mew-menu/menu-item.vue new file mode 100644 index 0000000..961be0a --- /dev/null +++ b/src/components/mew-menu/menu-item.vue @@ -0,0 +1,89 @@ + + diff --git a/src/components/mew-menu/menu.vue b/src/components/mew-menu/menu.vue new file mode 100644 index 0000000..392b57a --- /dev/null +++ b/src/components/mew-menu/menu.vue @@ -0,0 +1,156 @@ + + diff --git a/src/components/mew-menu/mixin.js b/src/components/mew-menu/mixin.js new file mode 100644 index 0000000..6c7be91 --- /dev/null +++ b/src/components/mew-menu/mixin.js @@ -0,0 +1,19 @@ +import { findComponentUpward, findComponentsUpward } from '../../utils/assist'; +export default { + data () { + return { + menu: findComponentUpward(this, 'Menu') + }; + }, + computed: { + hasParentSubmenu () { + return !!findComponentUpward(this, 'Submenu'); + }, + parentSubmenuNum () { + return findComponentsUpward(this, 'Submenu').length; + }, + mode () { + return this.menu.mode; + } + } +}; diff --git a/src/components/mew-menu/submenu.vue b/src/components/mew-menu/submenu.vue new file mode 100644 index 0000000..e4e5ae1 --- /dev/null +++ b/src/components/mew-menu/submenu.vue @@ -0,0 +1,181 @@ + + diff --git a/src/components/mew-submenu/index.js b/src/components/mew-submenu/index.js new file mode 100644 index 0000000..5642b56 --- /dev/null +++ b/src/components/mew-submenu/index.js @@ -0,0 +1,3 @@ +import Submenu from '../mew-menu/submenu.vue'; + +export default Submenu; \ No newline at end of file diff --git a/src/index.js b/src/index.js index b7706f1..3fbedef 100644 --- a/src/index.js +++ b/src/index.js @@ -36,6 +36,7 @@ import Menu from './components/menu'; import Message from './components/message'; import MewMap from './components/mew-map'; import MewMapSelector from './components/mew-map-selector'; +import MewMenu from './components/mew-menu'; import Modal from './components/modal'; import Notice from './components/notice'; import Page from './components/page'; @@ -113,6 +114,9 @@ const components = { Message, MewMap, MewMapSelector, + MewMenu, + MewMenuGroup: MewMenu.Group, + MewMenuItem: MewMenu.Item, Modal, Notice, Option: Option, -- libgit2 0.21.4