23 lines
376 B
JavaScript
23 lines
376 B
JavaScript
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 = {}
|
|
},
|
|
}
|