Vuex mapActions映射的问题?

我用dispatch代码没问题,

methods:{
    this.$store.dispatch('selectPlay', {list: this.songs, index: index})
}

但是我用mapActions就报错

methods:{
     this.selectPlay({
        list: this.songs,
        index: index
     }),
     ...mapActions([
       'selectPlay'
     ])
}

图片描述

请问我写的有什么问题?

阅读 2.1k
1 个回答

尴尬,

import {mapActions} from 'vuex'
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题