实现单机版

This commit is contained in:
叶志超
2021-12-22 19:32:34 +08:00
parent 5e1601c8ea
commit 141aa83f2d
16 changed files with 364 additions and 406 deletions

View File

@@ -0,0 +1,30 @@
const state = {
name: ''
}
// getters
// const getters = {
// get: (state) => state.name
// }
// actions
const actions = {
set ({ commit }, { satelliteSystem }) {
commit('set', satelliteSystem)
}
}
// mutations
const mutations = {
set (state, satelliteSystem) {
state.name = satelliteSystem
}
}
export default {
namespaced: true,
state,
// getters,
actions,
mutations
}

View File

@@ -3,16 +3,16 @@ const state = {
}
// getters
const getters = {
getSatelliteList: (state) => state.all
}
// const getters = {
// getSatelliteList: (state) => state.all
// }
// actions
const actions = {
load ({ commit }, { satellites }) {
commit('set', satellites)
}
}
// const actions = {
// load ({ commit }, { satellites }) {
// commit('set', satellites)
// }
// }
// mutations
const mutations = {
@@ -23,13 +23,15 @@ const mutations = {
toggleShow (state, id) {
const satellite = state.all.find(satellite => satellite.id === id)
satellite.show = !satellite.show
}
},
track () {}
}
export default {
namespaced: true,
state,
getters,
actions,
// getters,
// actions,
mutations
}

View File

@@ -0,0 +1,30 @@
const state = {
id: null
}
// getters
// const getters = {
// get: (state) => state.value
// }
// actions
const actions = {
set ({ commit }, { trackedSatelliteId }) {
commit('set', trackedSatelliteId)
}
}
// mutations
const mutations = {
set (state, trackedSatelliteId) {
state.id = trackedSatelliteId
}
}
export default {
namespaced: true,
state,
// getters,
actions,
mutations
}