Many pages or components to call the state, of vuex how to write the best ah?

store I used two modules, / store/index.js is as follows:

import Vue from "vue";
import Vuex from "vuex";
import app from "./modules/app";
import user from "./modules/user";

Vue.use(Vuex);

const store = new Vuex.Store({
  modules: {
    app,
    user
  }
});

export default store

/ store/modules/app.js is as follows:

const app = {
  state: {
    skills: null //
  },
  mutations: {},
  actions: {},
  getters:{}
}

export default app;

now I refer to the status directly in the data of all pages or components, such as

export default {
  data() {
    skills: this.$store.state.app.skills,
  }
}

this works, but is it reasonable?

I tried using

on the page.
import { mapGetters } from "vuex"
export default {
  computed: {
    ...mapGetters(["skills"]),
  },
}

this seems to be in line with the specification, but do you need to write all the properties of states in getters once return?? Feel redundant, huh?
I am grateful for your advice.

Mar.29,2021

use mapState?


use mapGetters!

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eac2b3-20aa.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eac2b3-20aa.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?