摘要:
使用pinia的action异步获取频道分类列表数据并渲染到页面中。 接口: GET请求,[http://geek.itheima.net/v1_0/channels](http://geek.itheima.net/v1_0/channels) store/channel.js ```Vue im 阅读全文
posted @ 2023-08-13 14:26
运维爱背锅
阅读(187)
评论(0)
推荐(0)
摘要:
- 在项目根目录创建store文件夹(此步骤和vuex相同) - 在步骤一的store文件夹下根据不同的用途场景创建单独的store文件(等同于vuex中分模块)、 
评论(0)
推荐(0)
摘要:
用你喜欢的js包管理器安装pinia: ```Bash yarn add pinia # 或者使用 npm npm install pinia ``` 创建一个 pinia 实例 (根 store) 并将其传递给应用: 编辑main.js: ```Vue import { createApp } f 阅读全文
posted @ 2023-08-13 14:25
运维爱背锅
阅读(88)
评论(0)
推荐(0)
摘要:
一款官方推荐的,代替vuex的,新的状态管理工具。 官方网: [https://pinia.vuejs.org/zh/introduction.html](https://pinia.vuejs.org/zh/introduction.html) **主要区别:** - 去除了modules的概念, 阅读全文
posted @ 2023-08-13 14:24
运维爱背锅
阅读(16)
评论(0)
推荐(0)