1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| import { mapActions, mapMutations, mapGetters } from 'vuex'
computed: { ...mapGetters([ 'searchHistory' ]) },
methods: { 某方法(){ this.saveSearchHistory(传入值) }, ...mapActions([ 'saveSearchHistory' ]),
某方法() { this.setFullScreen(传入值) }, ...mapMutations({ setFullScreen: 'SET_FULL_SCREEN' }) }
|