diff --git a/src/components/dropdown/dropdown.vue b/src/components/dropdown/dropdown.vue index 8c3ef5f8..9aaf681e 100644 --- a/src/components/dropdown/dropdown.vue +++ b/src/components/dropdown/dropdown.vue @@ -4,10 +4,7 @@ v-clickoutside="handleClose" @mouseenter="handleMouseenter" @mouseleave="handleMouseleave"> -
+
diff --git a/src/components/menu/menu-group.vue b/src/components/menu/menu-group.vue index f67cf44d..7236e457 100644 --- a/src/components/menu/menu-group.vue +++ b/src/components/menu/menu-group.vue @@ -1,13 +1,30 @@ \ No newline at end of file diff --git a/src/components/menu/menu-item.vue b/src/components/menu/menu-item.vue index f67cf44d..ee02e155 100644 --- a/src/components/menu/menu-item.vue +++ b/src/components/menu/menu-item.vue @@ -1,13 +1,42 @@ \ No newline at end of file diff --git a/src/components/menu/menu.vue b/src/components/menu/menu.vue index f67cf44d..c49f232c 100644 --- a/src/components/menu/menu.vue +++ b/src/components/menu/menu.vue @@ -1,13 +1,93 @@ \ No newline at end of file diff --git a/src/components/menu/submenu.vue b/src/components/menu/submenu.vue index f67cf44d..4f10b91e 100644 --- a/src/components/menu/submenu.vue +++ b/src/components/menu/submenu.vue @@ -1,13 +1,84 @@ \ No newline at end of file diff --git a/src/styles/components/menu.less b/src/styles/components/menu.less index e69de29b..df4c69f8 100644 --- a/src/styles/components/menu.less +++ b/src/styles/components/menu.less @@ -0,0 +1,138 @@ +@menu-prefix-cls: ~"@{css-prefix}menu"; +@menu-dropdown-item-prefix-cls: ~"@{menu-prefix-cls}-horizontal .@{menu-prefix-cls}-submenu .@{select-dropdown-prefix-cls} .@{menu-prefix-cls}-item"; + +.@{menu-prefix-cls} { + display: block; + margin: 0; + padding: 0; + outline: none; + list-style: none; + color: @text-color; + font-size: @font-size-base; + position: relative; + + &-horizontal{ + height: 60px; + line-height: 60px; + + &.@{menu-prefix-cls}-light{ + &:after{ + content: ''; + display: block; + width: 100%; + height: 1px; + background: @border-color-base; + position: absolute; + bottom: 0; + left: 0; + } + } + } + &-vertical{ + width: 240px; + &.@{menu-prefix-cls}-light{ + &:after{ + content: ''; + display: block; + width: 1px; + height: 100%; + background: @border-color-base; + position: absolute; + top: 0; + bottom: 0; + right: 0; + } + } + } + + &-light{ + background: #fff; + } + &-dark{ + background: @title-color; + } + &-primary{ + background: @primary-color; + } + + &-item{ + display: block; + outline: none; + list-style: none; + font-size: @font-size-base; + position: relative; + z-index: 1; + cursor: pointer; + transition: all @transition-time @ease-in-out; + + .@{menu-prefix-cls}-light &{ + color: @text-color; + } + .@{menu-prefix-cls}-dark &{ + color: @subsidiary-color; + &-active, &:hover{ + color: #fff; + } + } + .@{menu-prefix-cls}-primary &{ + color: #fff; + &-active, &:hover{ + background: @link-active-color; + } + } + } + &-horizontal &-item, + &-horizontal &-submenu + { + float: left; + padding: 0 20px; + position: relative; + cursor: pointer; + z-index: 1; + transition: all @transition-time @ease-in-out; + } + + &-light&-horizontal &-item, &-light&-horizontal &-submenu{ + height: inherit; + line-height: inherit; + border-bottom: 2px solid transparent; + &-active, &:hover{ + color: @primary-color; + border-bottom: 2px solid @primary-color; + } + } + + &-dark&-horizontal &-item{ + &-active, &:hover{ + color: #fff; + } + } + + &-primary&-horizontal &-item{ + &-active, &:hover{ + background: @link-active-color; + } + } + + &-horizontal &-submenu .@{select-dropdown-prefix-cls} { + width: 100%; + .@{menu-prefix-cls}-item{ + height: auto; + line-height: normal; + border-bottom: 0; + float: none; + } + } + + &-item-group{ + line-height: normal; + &-title { + padding-left: 8px; + font-size: 12px; + color: @legend-color; + height: 30px; + line-height: 30px; + } + } +} +.select-item(@menu-prefix-cls, @menu-dropdown-item-prefix-cls); \ No newline at end of file diff --git a/test/app.vue b/test/app.vue index fc1611ae..0cbef694 100644 --- a/test/app.vue +++ b/test/app.vue @@ -44,6 +44,7 @@ li + li {
  • Table
  • Dropdown
  • Tabs
  • +
  • Menu
  • diff --git a/test/main.js b/test/main.js index 1b1729f0..89559aed 100644 --- a/test/main.js +++ b/test/main.js @@ -117,6 +117,11 @@ router.map({ component: function (resolve) { require(['./routers/tabs.vue'], resolve); } + }, + '/menu': { + component: function (resolve) { + require(['./routers/menu.vue'], resolve); + } } }); diff --git a/test/routers/menu.vue b/test/routers/menu.vue new file mode 100644 index 00000000..cf73813e --- /dev/null +++ b/test/routers/menu.vue @@ -0,0 +1,70 @@ + + \ No newline at end of file diff --git a/test/routers/select.vue b/test/routers/select.vue index eb50e9e2..eb3828e1 100644 --- a/test/routers/select.vue +++ b/test/routers/select.vue @@ -1,16 +1,8 @@