Hide TieredMenu when a leaf is clicked
parent
9ca8437f0a
commit
64a9aa36e6
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<transition name="p-input-overlay" @enter="onEnter" @leave="onLeave">
|
||||
<div ref="container" :class="containerClass" v-if="popup ? visible : true">
|
||||
<TieredMenuSub :model="model" :root="true" :popup="popup" />
|
||||
<TieredMenuSub :model="model" :root="true" :popup="popup" @leaf-click="onLeafClick"/>
|
||||
</div>
|
||||
</transition>
|
||||
</template>
|
||||
|
@ -136,6 +136,11 @@ export default {
|
|||
else
|
||||
document.getElementById(this.appendTo).removeChild(this.$refs.container);
|
||||
}
|
||||
},
|
||||
onLeafClick() {
|
||||
if (this.popup) {
|
||||
this.hide();
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
|
@ -112,10 +112,7 @@ export default {
|
|||
},
|
||||
onLeafClick() {
|
||||
this.activeItem = null;
|
||||
|
||||
if (!this.root) {
|
||||
this.$emit('leaf-click');
|
||||
}
|
||||
this.$emit('leaf-click');
|
||||
},
|
||||
onItemKeyDown(event, item) {
|
||||
let listItem = event.currentTarget.parentElement;
|
||||
|
|
Loading…
Reference in New Issue