state
程序员文章站
2024-03-13 16:21:51
...
store.js“`
import vuex from ‘vuex’
import Vue from ‘vue’
Vue.use(vuex)
export default new vuex.Store({
state: {
user: []
},
mutations: {
setUser (state, v) {
state.user.push(v)
// state.user.splice(index, 1)
},
deleteUser (state, aa) {
var bb = state.user.indexOf('aa')
state.user.splice(bb, 1)
}
}
})
person-top
上一篇: JSF 文件下载