update Menu
update Menu
This commit is contained in:
parent
ab22fd7c52
commit
67f4d8e763
4 changed files with 174 additions and 174 deletions
|
@ -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 () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue