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

发布于 2022-09-12 01:55:49 字数 1011 浏览 20 评论 0

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深海少女心 2022-09-19 01:55:49

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文