Is declaring property (get() and set()) inside computed object is not allowed in vuejs?
The code works, however vscode shows tons of red color in the display, see screenshot for reference.
I'm not sure if vuejs or vscode triggers the error.
Farmer.js component
computed: {
...mapState("farmers", ["crud_step"]),
normal_data(){ //this works
return 'test';
},
step: { //this also works but this line causes an error display
get() {
return this.crud_step;
},
set(value) {
return this.SET_CRUD_STEP(value);
}
},
},
farmer.js store
const state = {[![enter image description here][1]][1]
crud_step: 1,
...
};
const mutations = {
SET_CRUD_STEP(state, value){
state.crud_step = value;
},
...
};
Note: eslint is disabled
Repo Link: https://github.com/juanPao/acms/blob/main/src/components/Farmers/FarmerCreate.vue
