elementplus select 点击按钮展开的方法 vue3
<el-select v-model="value" ref="selectRef" placeholder="请选择" > <el-option v-for="item in list" :key="item.id" :label="item.realName" :value="item.id" /> </el-select> <el-button @click="open">展开</el-button>
import { ref,, nextTick } from 'vue'
const selectRef = ref(null)
const open= async () => {
nextTick(() => {
// 选择框自动展开
selectRef.value.toggleMenu()
})
}

浙公网安备 33010602011771号