You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
408 B
24 lines
408 B
import Vue from 'vue'
|
|
import Vuex from 'vuex'
|
|
Vue.use(Vuex)
|
|
const store = new Vuex.Store({
|
|
state(){
|
|
return{
|
|
count: 0,
|
|
goodslist:[]
|
|
}
|
|
},
|
|
mutations: {
|
|
addSave(state, data) {
|
|
let str = data
|
|
console.log(data)
|
|
state.goodslist.push(str)
|
|
},
|
|
increment (state) {
|
|
state.count++
|
|
console.log(store.state.count) // -> 1
|
|
}
|
|
},
|
|
actions: {}
|
|
})
|
|
export default store
|