mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
* fix: resove conflict * feat: select basic usage * feat: select basic usage * feat: select feature create item * fix: fix option data insert * refactor: select * fix: fix parse error * feat: select test * fix: select add popper * fix: update select option * fix: add select dependency * fix: add index.ts file * fix(select): clean up * fix(select): some refactor * fix(select): some update * fix(select): fix all test cases Co-authored-by: helen <yinhelen.hlj@qq.com>
47 lines
855 B
Vue
47 lines
855 B
Vue
<template>
|
|
<div
|
|
class="el-select-dropdown"
|
|
:class="[{ 'is-multiple': isMultiple }, popperClass]"
|
|
:style="{ minWidth: minWidth }"
|
|
>
|
|
<slot></slot>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import {
|
|
computed,
|
|
onMounted,
|
|
inject,
|
|
} from 'vue'
|
|
import {
|
|
selectKey,
|
|
} from './token'
|
|
|
|
export default {
|
|
name: 'ElSelectDropdown',
|
|
|
|
componentName: 'ElSelectDropdown',
|
|
|
|
setup() {
|
|
const select = inject(selectKey)
|
|
|
|
// computed
|
|
const popperClass = computed(() => select.props.popperClass)
|
|
const isMultiple = computed(() => select.props.multiple)
|
|
const minWidth = computed(() => select.selectWrapper?.getBoundingClientRect().width + 'px')
|
|
|
|
onMounted(() => {
|
|
// TODO: updatePopper
|
|
// popper.value.update()
|
|
})
|
|
|
|
return {
|
|
minWidth,
|
|
popperClass,
|
|
isMultiple,
|
|
}
|
|
},
|
|
}
|
|
</script>
|