官方的例子
function fetchItem (store) {
return store.dispatch('FETCH_ITEMS', {
ids: [store.state.route.params.id]
})
}
为什么不直接采用:
function fetchItem (store) {
//发起http请求
axios({url:**})....
}
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
https://github.com/vuejs/vue-...
这是作者的回答