2016-07-27 06:15:02 +00:00
|
|
|
<template>
|
2016-12-03 10:59:04 +00:00
|
|
|
<transition name="el-zoom-in-top" @after-leave="doDestroy">
|
2016-11-04 05:59:03 +00:00
|
|
|
<ul class="el-dropdown-menu" v-show="showPopper">
|
2016-10-13 05:54:02 +00:00
|
|
|
<slot></slot>
|
|
|
|
</ul>
|
2016-10-12 10:29:24 +00:00
|
|
|
</transition>
|
2016-07-27 06:15:02 +00:00
|
|
|
</template>
|
|
|
|
<script>
|
2016-10-13 03:12:24 +00:00
|
|
|
import Popper from 'element-ui/src/utils/vue-popper';
|
2016-07-27 06:15:02 +00:00
|
|
|
|
|
|
|
export default {
|
2016-10-05 03:03:44 +00:00
|
|
|
name: 'ElDropdownMenu',
|
|
|
|
|
2016-10-12 10:29:24 +00:00
|
|
|
componentName: 'ElDropdownMenu',
|
2016-07-27 06:15:02 +00:00
|
|
|
|
2016-10-12 10:29:24 +00:00
|
|
|
mixins: [Popper],
|
|
|
|
|
|
|
|
created() {
|
2017-06-07 03:15:25 +00:00
|
|
|
this.$on('updatePopper', () => {
|
|
|
|
if (this.showPopper) this.updatePopper();
|
|
|
|
});
|
2016-10-12 10:29:24 +00:00
|
|
|
this.$on('visible', val => {
|
|
|
|
this.showPopper = val;
|
2016-07-27 06:15:02 +00:00
|
|
|
});
|
|
|
|
},
|
|
|
|
|
2016-10-12 10:29:24 +00:00
|
|
|
mounted() {
|
2016-10-12 14:59:46 +00:00
|
|
|
this.$parent.popperElm = this.popperElm = this.$el;
|
2016-10-12 10:29:24 +00:00
|
|
|
this.referenceElm = this.$parent.$el;
|
|
|
|
},
|
|
|
|
|
2016-12-29 02:41:19 +00:00
|
|
|
watch: {
|
2016-12-29 08:37:46 +00:00
|
|
|
'$parent.menuAlign': {
|
|
|
|
immediate: true,
|
|
|
|
handler(val) {
|
|
|
|
this.currentPlacement = `bottom-${val}`;
|
|
|
|
}
|
2016-10-12 10:29:24 +00:00
|
|
|
}
|
2016-07-27 06:15:02 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|