🚧 Site > Add Vue store

This commit is contained in:
brunosimon
2017-08-04 09:05:44 +02:00
parent 1aa3e5f135
commit eec6f8a796
15 changed files with 114 additions and 23 deletions
+33
View File
@@ -0,0 +1,33 @@
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state:
{
projects: [],
currentProject: null
},
mutations:
{
updateProjects(state, data)
{
for(const key in data)
{
const project = data[key]
state.projects.push(project)
}
},
addProject(state, data)
{
state.projects.push(data)
},
removeProject(state, data)
{
console.log(data)
}
}
})