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">
|
2017-09-19 04:47:13 +00:00
|
|
|
<ul class="el-dropdown-menu el-popper" :class="[size && `el-dropdown-menu--${size}`]" 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],
|
|
|
|
|
2017-10-01 12:16:16 +00:00
|
|
|
props: {
|
|
|
|
visibleArrow: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true
|
2018-03-28 03:36:23 +00:00
|
|
|
},
|
|
|
|
arrowOffset: {
|
|
|
|
type: Number,
|
|
|
|
default: 0
|
2017-10-01 12:16:16 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2017-08-02 15:31:36 +00:00
|
|
|
data() {
|
|
|
|
return {
|
2017-11-24 02:42:04 +00:00
|
|
|
size: this.dropdown.dropdownSize
|
2017-08-02 15:31:36 +00:00
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
inject: ['dropdown'],
|
|
|
|
|
2016-10-12 10:29:24 +00:00
|
|
|
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: {
|
2017-08-02 15:31:36 +00:00
|
|
|
'dropdown.placement': {
|
2016-12-29 08:37:46 +00:00
|
|
|
immediate: true,
|
|
|
|
handler(val) {
|
2017-08-02 15:31:36 +00:00
|
|
|
this.currentPlacement = val;
|
2016-12-29 08:37:46 +00:00
|
|
|
}
|
2016-10-12 10:29:24 +00:00
|
|
|
}
|
2016-07-27 06:15:02 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|