update Menu

update Menu
This commit is contained in:
梁灏 2017-03-15 18:26:10 +08:00
parent ab22fd7c52
commit 67f4d8e763
4 changed files with 174 additions and 174 deletions

View file

@ -2,7 +2,7 @@
<ul :class="classes" :style="styles"><slot></slot></ul>
</template>
<script>
import { oneOf } from '../../utils/assist';
import { oneOf, findComponentsDownward } from '../../utils/assist';
import Emitter from '../../mixins/emitter';
const prefixCls = 'ivu-menu';
@ -84,11 +84,13 @@
}
},
updateOpened () {
this.$children.forEach(item => {
if (item.$options.name === 'Submenu') {
const items = findComponentsDownward(this, 'Submenu');
if (items.length) {
items.forEach(item => {
if (this.openNames.indexOf(item.name) > -1) item.opened = true;
}
});
});
}
}
},
mounted () {