vue @change 第一次没有获取到值

新手上路,请多包涵
<mt-popup
      v-model="popupVisible1"
      position="bottom">
      {{value.id}}
      <mt-radio
        title="选择项目下单"
        v-model="value"
        :options="options" @change="monitor">
      </mt-radio>
    </mt-popup>

data(){

return{
    value:"",
    options:[],
}

}

 monitor(){
      this.$api.addShoppingCartQianyue({pro_id:this.value.id,mat_id:this.id,mod_id:this.materialId,colorId:this.colors[this.number1] ? this.colors[this.number1].id : '',elementId:this.element[this.number2] ? this.element[this.number2].id : '',styleId:this.style[this.number3] ? this.style[this.number3].id : '',textureId:this.texture[this.number4] ? this.texture[this.number4].id : '',memberId:localStorage.getItem("userId")?localStorage.getItem("userId"):localStorage.getItem("Identification"),num:this.num}).then(res =>{
        this.nums = res.data.data
        this.popupVisible1 = false
      })
    },
阅读 3.5k
1 个回答

有可能你的 @change 事件没触发,如果你依赖这个方法获取数据,你应该在生命周期中获取数据

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题