Computed property was assigned to but it has no setter

更改前

 computed: {
            isShowAnswerCom() {
                return this.isShowErrorQuestion === 0 ? this.isShowAnswer : 1
            }
        },

更改后

computed: {
    isShowAnswerCom: {
      get () {
        return this.isShowErrorQuestion === 0 ? this.isShowAnswer : 1
      },
      set (v) {
        this.isShowAnswer = v
      }
    }
  },

猜你喜欢

转载自blog.csdn.net/weixin_50114203/article/details/125372153