We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 33afb40 commit c890b62Copy full SHA for c890b62
shells/dev/target/Counter.vue
@@ -16,6 +16,7 @@
16
<p>foo: {{ foo }}</p>
17
<p>twoFoos: {{ twoFoos }}</p>
18
<button @click="addBar">Add bar</button>
19
+ <button @click="removeBar">Remove bar</button>
20
</div>
21
22
</template>
@@ -69,7 +70,8 @@ export default {
69
70
},
71
72
...mapMutations('nested', {
- addBar: 'ADD_BAR'
73
+ addBar: 'ADD_BAR',
74
+ removeBar: 'REMOVE_BAR'
75
})
76
}
77
shells/dev/target/store.js
@@ -62,6 +62,9 @@ export default new Vuex.Store({
62
mutations: {
63
ADD_BAR: (state) => {
64
state.foo += 'bar'
65
+ },
66
+ REMOVE_BAR: (state) => {
67
+ state.foo = state.foo.substr('bar'.length)
68
0 commit comments