不支持

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()
  }) 
}

  

posted @ 2024-06-12 10:53  骑上我的小摩托  阅读(111)  评论(0编辑  收藏  举报