'vuex-module-decorators' 重复变量 - @Mutation 创建了一个新的错误变量,该变量在原始类中不存在

问题描述

我的类中有以下带有数据的代码

export class BlocRcr extends BlocAbstract {

private _internalBlocoperator = 0;

set setInternalBlocoperator(value: number) {
      this._internalBlocoperator = value;
}

..我使用这个模块来持久化地放置和获取数据

import {Action,Module,Mutation,VuexModule} from 'vuex-module-decorators';
//Getter
   @Action({rawError: true})
   get getPersistentContextBlocRcrInternalOperatorSelected(): number {
      return this.context.rootState.RequeteDeRecherche.blocRcr._internalBlocoperator;
   }
   @Action({rawError: true})
   get getBlocRcrInternalOperatorSelected(): number {
      return this.context.getters['getPersistentContextBlocRcrInternalOperatorSelected'];
   }
//Setter
   @Mutation
   async setBlocRcrInternalOperator(operator: number) {
      this.blocRcr.setInternalBlocoperator = operator;
   }

..在我的组件中,有一个调用 setter 的事件。 但是当我用我的变量在控制台中查看我的对象时,它包含一个没有下划线的新变量,并且没有更新目标变量。此行为不会在第一次数据更改期间发生,而是在第二次更改期间发生。为什么会发生?新变量在原类中不存在。

这样,为什么?我只想设置原始变量,而不是一个最初不存在的新创建的变量。

The wrong variable created ...

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...