import { createStore } from 'vuex' // 创建一个新的 store 实例 const store = createStore({ // 值的存储 获取: this.$store.state.xxxx state() { return { } }, //计算state的值 获取: this.$store.getters.xxxx getters: { }, // 数据更新 使用: this.$store.commit('函数名','val') mutations: { } }) export default store