1234567891011121314151617181920212223242526272829303132333435363738394041 |
- const state = {
- appConfig: {
- title: "Loading...",
- appBarColor: "#114514",
- telwsUrl: "/api/telws/",
- projectName: "Loading...",
- projectDescription: "Loading..."
- }
- }
- const getters = {
- getTitle: (st) => () => st.appConfig.title,
- getAppBarColor: (st) => () => st.appConfig.appBarColor,
- getTelwsUrl: (st) => () => st.appConfig.telwsUrl,
- getProjectName: (st) => () => st.appConfig.projectName,
- getProjectDescription: (st) => () => st.appConfig.projectDescription,
- }
- const types = {
- setConfig: "setConfig"
- }
- const mutations = {
- [types.setConfig](st, cfg) {
- st.appConfig = cfg
- }
- }
- const actions = {
- setConfig({ commit }, cfg) {
- commit(types.setConfig, cfg)
- }
- }
- export default {
- state,
- getters,
- types,
- mutations,
- actions
- }
|