1、state.js:const state = { myEmail:"" }
2、mutations: const mutations = { SET_EMAIL (state,date){ state.myEmail = date } } (SET_EMAIL随意命名)
3、getters:const getters = { getEmails: state => state.myEmail, }
4、portrait.vue:this.$store.commit("SET_EMAIL", this.basicMsg.client_email); 将值附上
5、ballG.vue:console.log(this.$store); console.log(this.$store.state.myEmail); 获取值this.basicMsg.client_email
portrait.vue 传email到 ballG.vue
最新推荐文章于 2024-06-29 16:43:56 发布