knowyt/client/src/store/selection.js

23 lines
376 B
JavaScript
Raw Normal View History

2021-08-27 12:43:14 +00:00
export const state = () => ({
selection: {},
})
export const mutations = {
select(state, id) {
state.selection = {
...state.selection,
[id]: true,
}
},
unselect(state, id) {
var selection = state.selection
delete selection[id]
state.selection = {
...selection
}
},
clearSelection(state) {
state.selection = {}
},
}