publish 0.9.10-rc-2

publish 0.9.10-rc-2
This commit is contained in:
梁灏 2016-12-08 18:33:04 +08:00
parent fd5cd82376
commit fc3ffbe08d
6 changed files with 95 additions and 149 deletions

View file

@ -19,12 +19,6 @@
return {
prefixCls: prefixCls
}
},
computed: {
},
methods: {
}
}
</script>

View file

@ -1,5 +1,5 @@
<template>
<ul :class="classes"><slot></slot></ul>
<ul :class="classes" :style="styles"><slot></slot></ul>
</template>
<script>
import { oneOf } from '../../utils/assist';
@ -32,11 +32,10 @@
accordion: {
type: Boolean,
default: false
}
},
data () {
return {
},
width: {
type: String,
default: '240px'
}
},
computed: {
@ -51,12 +50,21 @@
[`${prefixCls}-${this.mode}`]: this.mode
}
]
},
styles () {
let style = {};
if (this.mode === 'vertical') style.width = this.width;
return style;
}
},
methods: {
updateActiveKey () {
this.$children.forEach((item, index) => {
if (!this.activeKey && index === 0) this.activeKey = item.key;
if (!this.activeKey && index === 0) {
this.activeKey = -1;
}
if (item.$options.name === 'Submenu') {
item.active = false;
@ -95,10 +103,18 @@
} else {
this.openKeys.push(key);
}
},
updateOpened () {
this.$children.forEach(item => {
if (item.$options.name === 'Submenu') {
if (this.openKeys.indexOf(item.key) > -1) item.opened = true;
}
})
}
},
compiled () {
this.updateActiveKey();
this.updateOpened();
},
events: {
'on-menu-item-select' (key) {

View file

@ -41,7 +41,7 @@
margin-bottom: 5px;
font-size: 14px;
}
ul ul, ol ul{
ul ul:not([class^="ivu-"]), ol ul:not([class^="ivu-"]){
list-style-type: circle;
}

View file

@ -29,7 +29,6 @@
}
}
&-vertical{
width: 240px;
&.@{menu-prefix-cls}-light{
&:after{
content: '';
@ -125,8 +124,13 @@
padding-left: 8px;
font-size: @font-size-small;
color: @legend-color;
height: 30px;
line-height: 30px;
height: 48px;
line-height: 48px;
}
& > ul{
padding: 0 !important;
list-style: none !important;
}
}
@ -183,9 +187,15 @@
&-dark&-vertical &-item, &-dark&-vertical &-submenu-title{
color: @subsidiary-color;
&-active:not(.@{menu-prefix-cls}-submenu), &:hover{
&-active:not(.@{menu-prefix-cls}-submenu),
&-active:not(.@{menu-prefix-cls}-submenu):hover
{
background: @menu-dark-active-bg;
}
&:hover{
color: #fff;
background: @title-color;
}
&-active:not(.@{menu-prefix-cls}-submenu){
color: @primary-color;
border-right: 2px solid @primary-color;
@ -194,16 +204,23 @@
&-dark&-vertical &-submenu &-item{
&:hover{
color: #fff;
background: transparent !important;
}
&-active{
&-active,&-active:hover{
border-right: none;
color: #fff;
background: @primary-color;
background: @primary-color !important;
}
}
&-dark&-vertical &-item-active &-submenu-title{
color: #fff;
}
&-dark&-vertical &-opened{
background: @menu-dark-active-bg;
.@{menu-prefix-cls}-submenu-title{
background: @title-color;
}
}
}
.select-item(@menu-prefix-cls, @menu-dropdown-item-prefix-cls);