When Vue calculates the default value of the attribute, it is correct to choose the question. When it is not selected, it returns 0, but he returns NAN.

computed: {

cartPrice() {
   let tmp = 0
   let tmpArr =[]
  if (this.goodsList.length) {
    tmpArr = this.goodsList.map(value => value.isChecked==true && value)
    tmpArr.forEach(value => (tmp += value.count * value.PRESENT_PRICE))
  }

  return tmp;
}

}

Jun.07,2022

actually return tmp | | 0 that's it < del > ~ < / del > < del > ~ < / del > I'm a pig--


  

conditional judgment statement is not accurate
false & & item returns false
replace map with filter

Menu