setup 里使用 vuex
import { useStore, // mapState, // mapMutations, // mapActions, // mapGetters } from 'vuex' setup() { const store = useStore() const state = store.state const getters = store.getters // console.log(mapState(store.state),'mapState') // console.log(mapMutations(store._mutations),'mapMutations') // console.log(mapActions(store._actions),'mapActions') // console.log(mapGetters(store.getters),'mapGetters') store.commit('test', test) store.dispatch('asyncTest') }