0👍
✅
There is two issues with your code:
-
v-model
should be used withdata
only and not withcomputed
. acomputed
property value in Vue.js can not be changed unless the value or one of the values it depends on has changed. -
You can not update the state directly. This is one of vuex rules. To update it you have to use a vuex mutation for that.
So the solution is:
-
Create a
data
property calledtempPageLimit
and bind it to the input usingv-model
. -
In the
store
, Create a mutation that update thepageLimit
with the value of thetempPageLimit
and map it to your component usingmapMutations
. -
Execute this mutation inside the
onSave
method.
look here if you want to read about vuex mutations.
Source:stackexchange.com