first commit
This commit is contained in:
35
src/render/store/modules/satellites.js
Normal file
35
src/render/store/modules/satellites.js
Normal file
@@ -0,0 +1,35 @@
|
||||
const state = {
|
||||
all: []
|
||||
}
|
||||
|
||||
// getters
|
||||
const getters = {
|
||||
getSatelliteList: (state) => state.all
|
||||
}
|
||||
|
||||
// actions
|
||||
const actions = {
|
||||
load ({ commit }, { satellites }) {
|
||||
commit('set', satellites)
|
||||
}
|
||||
}
|
||||
|
||||
// mutations
|
||||
const mutations = {
|
||||
set (state, satellites) {
|
||||
state.all = satellites
|
||||
},
|
||||
|
||||
toggleShow (state, id) {
|
||||
const satellite = state.all.find(satellite => satellite.id === id)
|
||||
satellite.show = !satellite.show
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
getters,
|
||||
actions,
|
||||
mutations
|
||||
}
|
||||
Reference in New Issue
Block a user