vuex模块状态管理进行模块间的通信
//1.创建名为store;//2.创建名为index.js文件;//内容:import Vue from "vue";import Vuex from "vuex";Vue.use(Vuex);const state = {show: 1,};export default new Vuex.Store({state,});//3.在main.js入口文件中配置store,引入store文件并导出即可;//4.全局调用方法:this.$store.state.show;//computed方法可以监听数据的变化computed: {abtSub: function () {return this.$store.state.show;}}