2016-07-27 06:15:02 +00:00
|
|
|
<template>
|
2016-10-12 10:29:24 +00:00
|
|
|
<transition name="md-fade-bottom" @after-leave="doDestroy">
|
|
|
|
<ul class="el-dropdown__menu" v-show="showPopper">
|
2016-07-27 06:15: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() {
|
|
|
|
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;
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
placement() {
|
|
|
|
return `bottom-${this.$parent.menuAlign}`;
|
|
|
|
}
|
2016-07-27 06:15:02 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|