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)
}
}
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论