文章詳情頁
javascript - vue 通過賦值改變select的value怎么觸發change事件
瀏覽:161日期:2023-04-09 09:08:05
問題描述
從后臺獲取到select的值并賦值給select,怎么觸發change事件html代碼簡寫如下:
<select v-model='resData.type' @change='supRes(resData.type)' > <option value=''>--請選擇--</option> <option value='2'>123</option> <option value='3'>456</option></select>
js代碼簡寫如下:
axios({ method:'get', url:'***', params:{ id : row.id } }).then((res)=>{ var data = res.data.content; this.resData = { type : data.type } })supRes:function(val){ console.log(val)}
問題解答
回答1:是不是可以直接 watch resData.type ? 變相的change
回答2:手動trigger一下
標簽:
JavaScript
相關文章:
1. docker - 各位電腦上有多少個容器啊?容器一多,自己都搞混了,咋辦呢?2. docker start -a dockername 老是卡住,什么情況?3. docker容器呢SSH為什么連不通呢?4. Android listview checkbox 單選5. 關docker hub上有些鏡像的tag被標記““This image has vulnerabilities””6. Android TextView 或 ListView 加載過渡效果7. python-mysql Commands out of sync8. Python列表或者字典里面的中文如何處理?9. 爬蟲圖片 - 關于Python 爬蟲的問題10. python - (初學者)代碼運行不起來,求指導,謝謝!
排行榜
