Elementui select 设置点击事件,在Change事件前触发
生活随笔
收集整理的這篇文章主要介紹了
Elementui select 设置点击事件,在Change事件前触发
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
想要在changge事件觸發(fā)前,來觸發(fā)一個事件,可以直接在 Select 選擇器上面添加點擊事件,但是這樣點擊事件是不會生效的,需要在點擊事件后面加上native
<el-selectv-model="list.userJumpId"clearableplaceholder="請選擇二跳頁名稱/ID"style="width: 250px":disabled="userJumpNameDisabled"@click.native="clickUserJumpIdState"@change="userJumpChange"><template v-if="cateIds"><el-optionv-for="item in userJumpIdList":key="item.id":label="`二跳頁名稱:${item.name} / 二跳頁ID: ${item.id}`":value="item.id"></el-option></template></el-select>加上.native后,只要點擊到了select ,就會觸發(fā)該事件,并且可以配合 watch,以及 disabled 事件來禁止select ,該點擊事件會比change事件觸發(fā)時間更早。
總結(jié)
以上是生活随笔為你收集整理的Elementui select 设置点击事件,在Change事件前触发的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 不用路由器让两台电脑联网-不用电脑上网如
- 下一篇: 淋浴的价格是多少