目标
请求获取数据存入 vuex, 映射渲染
![](https://img-blog.csdnimg.cn/img_convert/19656d43cf935a3cefcf8c3c07827dea.png)
- 安装 axios
jsx
yarn add axios
-
准备actions 和 mutations
-
App.vue
页面中调用 action, 获取数据
验证数据是否存储成功
![](https://img-blog.csdnimg.cn/img_convert/40d17481199d417564e98dad2a2eeaa6.png)
- 动态渲染
cart-item.vue
目标
请求获取数据存入 vuex, 映射渲染
yarn add axios
准备actions 和 mutations
App.vue
页面中调用 action, 获取数据
验证数据是否存储成功
cart-item.vue