You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.0 KiB
49 lines
1.0 KiB
|
6 years ago
|
<template>
|
||
|
|
<div
|
||
|
6 years ago
|
class="el-select-dropdown el-popper"
|
||
|
|
:class="[{ 'is-multiple': $parent.multiple }, popperClass]"
|
||
|
|
:style="{ minWidth }"
|
||
|
6 years ago
|
>
|
||
|
6 years ago
|
<slot/>
|
||
|
|
</div>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script type="text/babel">
|
||
|
6 years ago
|
import Popper from '@ele/mixin/vue-popper'
|
||
|
6 years ago
|
|
||
|
|
export default {
|
||
|
|
name: 'ElSelectDropdown',
|
||
|
|
|
||
|
|
componentName: 'ElSelectDropdown',
|
||
|
|
|
||
|
|
mixins: [Popper],
|
||
|
|
|
||
|
|
data() {
|
||
|
|
return {
|
||
|
|
minWidth: ''
|
||
|
|
}
|
||
|
|
},
|
||
|
|
|
||
|
|
computed: {
|
||
|
|
popperClass() {
|
||
|
|
return this.$parent.popperClass
|
||
|
|
}
|
||
|
|
},
|
||
|
|
|
||
|
|
watch: {
|
||
|
|
'$parent.inputWidth'() {
|
||
|
|
this.minWidth = this.$parent.$el.getBoundingClientRect().width + 'px'
|
||
|
6 years ago
|
}
|
||
|
6 years ago
|
},
|
||
|
|
|
||
|
|
mounted() {
|
||
|
|
this.referenceElm = this.$parent.$refs.reference.$el
|
||
|
|
this.$parent.popperElm = this.popperElm = this.$el
|
||
|
|
this.$on('updatePopper', () => {
|
||
|
|
this.$parent.visible && this.updatePopper()
|
||
|
|
})
|
||
|
|
this.$on('destroyPopper', this.destroyPopper)
|
||
|
6 years ago
|
}
|
||
|
6 years ago
|
}
|
||
|
6 years ago
|
</script>
|