This repository has been archived on 2021-09-06. You can view files and clone it, but cannot push or open issues or pull requests.
vuejs_course/2021-05-04_vuex-01-starting.../src/store.js

17 lines
235 B
JavaScript
Raw Normal View History

2021-05-04 18:05:03 +02:00
import { createStore } from 'vuex';
const store = createStore({
state() {
return {
counter: 0
};
2021-05-04 21:49:40 +02:00
},
mutations: {
increment(state) {
state.counter = state.counter + 1;
}
2021-05-04 18:05:03 +02:00
}
});
export default store;