Skip to content

Commit

Permalink
Add super basic store example
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Richter committed Apr 11, 2018
1 parent aedd2a6 commit e4c6414
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import 'babel-polyfill'
import Vue from 'vue'
import App from './App.vue'
import router from './router.js'
import store from './store.js'

/* eslint-disable no-new */
new Vue({
el: '#app',
router,
store,
render: h => h(App),
})
33 changes: 33 additions & 0 deletions src/store.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
state: {
todos: [{
title: 'Todo A',
project: 'Project A',
done: false,
}, {
title: 'Todo B',
project: 'Project B',
done: true,
}, {
title: 'Todo C',
project: 'Project C',
done: false,
}, {
title: 'Todo D',
project: 'Project D',
done: false,
}],
},
mutations: {
// addTodo (state) {
// console.log('addTodo: %o', state)
// // state.todos
// },
},
})

0 comments on commit e4c6414

Please sign in to comment.