vuex的actions传的第二个参数是undefined?

this.$store.dispatch('fetchRoomLists', this.$route.params.id, productId)
=》
const info = {id: this.$route.params.id, productId: productId}
this.$store.dispatch('fetchRoomLists', info)

productId 传到 vuex的时候变成了undefind,如果要传多值,组成对象后传

this.$store.commit(xxxx , {aaa: 'aaa', bbb: 'bbb'})
const mutations = {
    [xxxx] (state, {aaa, bbb}) {
        console.log(aaa, bbb)
    }
}

你可能感兴趣的:(vue.jsvuex)