当前位置:网站首页>[listening for an attribute in the array]

[listening for an attribute in the array]

2022-07-05 09:28:00 Guodong pudding

【 Listening for an attribute in the array 】

One 、 structure
 Insert picture description here  Insert picture description here

  computed : {
    amount : function () {
       JSON.parse(JSON.stringify(this.linke.newList))

       JSON.parse(JSON.stringify(this.linke.oldList))
       return
    }
  },
  watch : {
    amount : {
      handler (newVal) {
        // console.log(newVal , 'newVal')
        // console.log(oldVal , 'oldVal')
        let aaa  = this.linke.oldList.reduce((sum, e) => sum + Number(e.amount || 0), 0)
        let bbb  = this.linke.newList.reduce((sum, e) => sum + Number(e.amount || 0), 0)
        this.CardrftNo = this.linke.oldList.length + this.linke.newList.length
        this.CardrftNoMoney = aaa + bbb
      } ,
      immediate : false,
      deep: true
    }
  },
原网站

版权声明
本文为[Guodong pudding]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207050927020310.html