javascript - How does vue trigger the change event by changing the value of the select through assignment?
typecho
typecho 2017-07-05 10:38:50
0
2
1404

Get the value of select from the background and assign it to select, how to trigger the change event
The abbreviation of the html code is as follows:

<select v-model="resData.type" @change="supRes(resData.type)" >
    <option value="">--请选择--</option>
    <option value="2">123</option>
    <option value="3">456</option>
</select>

js code abbreviation is as follows:

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

Following the voice in heart.

reply all(2)
某草草

Is it possible to watch resData.type directly? Change in disguise

Peter_Zhu

Trigger manually

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template