问题描述
我的类中有以下带有数据的代码
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 (将#修改为@)