// handleChange鼠标右键才会触发
<divv-for="(item, index) in list":key="index"@click.right.prevent="handleChange(item)">// 将trigger设置成manual,去掉默认触发拉下菜单的行为,添加ref<el-dropdowntrigger="manual":ref="`dropdown${item.id}`"><divclass="tb-dropdown"><span>{{ item.code }}</span></div><el-dropdown-menuslot="dropdown"class="lang-select-dropdown"><el-dropdown-itemcommand="0">黄金糕</el-dropdown-item><el-dropdown-itemcommand="1">狮子头</el-dropdown-item></el-dropdown-menu></el-dropdown></div>
data(){return{list:[{id:1,code:1},{id:2,code:2},]}},methods:{handleChange(item){const name =`dropdown${item.id}`// 将触发的选择显示;showthis.$refs[name][0].show()}}