ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
[TOC] #### Vuex 命名空间获取 state ~~~ import { createNamespacedHelpers } from 'vuex' const { mapState, mapActions } = createNamespacedHelpers('命名空间名称') export default { computed: { ...mapState({ a: state => state.a, b: state => state.b }) }, methods: { ...mapActions([ 'foo', 'bar' ]) } } ~~~