2016-07-27 06:15:02 +00:00
|
|
|
<template>
|
2016-10-12 09:41:49 +00:00
|
|
|
<div
|
2017-09-21 02:55:46 +00:00
|
|
|
class="el-select-dropdown el-popper"
|
2016-12-20 08:38:47 +00:00
|
|
|
:class="[{ 'is-multiple': $parent.multiple }, popperClass]"
|
2016-10-12 09:41:49 +00:00
|
|
|
:style="{ minWidth: minWidth }">
|
2016-07-27 06:15:02 +00:00
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script type="text/babel">
|
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-12-31 15:33:51 +00:00
|
|
|
name: 'ElSelectDropdown',
|
2016-07-27 06:15:02 +00:00
|
|
|
|
2016-11-26 07:18:38 +00:00
|
|
|
componentName: 'ElSelectDropdown',
|
2016-07-27 06:15:02 +00:00
|
|
|
|
2016-10-12 09:41:49 +00:00
|
|
|
mixins: [Popper],
|
2016-07-27 06:15:02 +00:00
|
|
|
|
2016-10-12 09:41:49 +00:00
|
|
|
props: {
|
|
|
|
placement: {
|
|
|
|
default: 'bottom-start'
|
2016-07-27 06:15:02 +00:00
|
|
|
},
|
|
|
|
|
2016-10-12 09:41:49 +00:00
|
|
|
boundariesPadding: {
|
|
|
|
default: 0
|
2016-07-27 06:15:02 +00:00
|
|
|
},
|
|
|
|
|
2017-01-18 09:17:59 +00:00
|
|
|
popperOptions: {
|
2016-10-12 09:41:49 +00:00
|
|
|
default() {
|
|
|
|
return {
|
|
|
|
gpuAcceleration: false
|
|
|
|
};
|
|
|
|
}
|
2017-09-21 02:55:46 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
visibleArrow: {
|
|
|
|
default: true
|
2018-02-11 10:18:49 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
appendToBody: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true
|
2016-07-27 06:15:02 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2016-10-12 09:41:49 +00:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
minWidth: ''
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
2016-12-20 08:38:47 +00:00
|
|
|
computed: {
|
|
|
|
popperClass() {
|
|
|
|
return this.$parent.popperClass;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2016-10-12 09:41:49 +00:00
|
|
|
watch: {
|
|
|
|
'$parent.inputWidth'() {
|
|
|
|
this.minWidth = this.$parent.$el.getBoundingClientRect().width + 'px';
|
2016-07-27 06:15:02 +00:00
|
|
|
}
|
2016-10-12 09:41:49 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
this.referenceElm = this.$parent.$refs.reference.$el;
|
|
|
|
this.$parent.popperElm = this.popperElm = this.$el;
|
2017-06-07 03:15:25 +00:00
|
|
|
this.$on('updatePopper', () => {
|
|
|
|
if (this.$parent.visible) this.updatePopper();
|
|
|
|
});
|
2016-10-12 13:12:54 +00:00
|
|
|
this.$on('destroyPopper', this.destroyPopper);
|
2016-07-27 06:15:02 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|