vue中this.$set()的用法

vue中this.$set()的用法:

         res2 = await queryMyGroupOrderCount() // **集团数量统计**
        if (res2) {
          if (res2 && newVal === 1) {
            this.$set(this.taskOrderObj, 'draftNum', res2.draftNum || 0)
            this.$set(this.taskOrderObj, 'readNowNum', res2.readNowNum || 0)
            this.$set(this.taskOrderObj, 'dealNowNum', res2.dealNowNum || 0)
            this.$set(this.taskOrderObj, 'myTaskNum', res2.myTaskNum || 0)
          } else if (newVal === 2) {
            this.$set(this.groupOrderObj, 'draftNum', res2.draftNum || 0)
            this.$set(this.groupOrderObj, 'readNowNum', res2.readNowNum || 0)
            this.$set(this.groupOrderObj, 'dealNowNum', res2.dealNowNum || 0)
            this.$set(this.groupOrderObj, 'myTaskNum', res2.myTaskNum || 0)
          }
        }

新手看老代码记录,不喜勿喷!

你可能感兴趣的:(前端,vue.js,前端,javascript)