computed计算属性get、set

defaultAppLanguageId(){
      return this.$store.state.common.gameInfo.defaultLanguageId;
    }

我将上面的这个计算属性绑定到了选择框中

报错如下:

 于是给它加个get和set就可以了

defaultAppLanguageId:{
      get() {
          return this.$store.state.common.gameInfo.defaultLanguageId
      },
      set(newVal) {
          newVal = this.$store.state.common.gameInfo.defaultLanguageId
      }
    },

原文地址:https://www.cnblogs.com/fqh123/p/14805431.html