日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

小程序Arrow function should not return assignment

作者:hellolipop 更新時間: 2022-04-04 編程語言
 // 選中所有或反選
    changeAll() {
      // 判斷是否已經全選,如果全選則讓每一項為false
      let flag = this.goodsList.every(item => item.isChecked === true)
      if (flag) {
        this.goodsList.forEach(item => item.isChecked = false)
      } else {
        this.goodsList.forEach(item => item.isChecked = true)
      }
      // 將改變后的結果存放到存儲中
      this.setShopList()
      this.getCount()
      this.getMoney()
    }

各種嘗試之后發現遍歷時如果是改變了原屬組的內容就會報錯,而我需要的就是改變原數組,暫時還沒解決,找到方法再來
eslint錯誤提示

原文鏈接:https://blog.csdn.net/weixin_45366905/article/details/107059756

欄目分類
最近更新