当前位置:网站首页>11 pinia使用
11 pinia使用
2022-07-31 15:06:00 【是云呀!】
一,pinia与vuex区别

二,使用
npm i pinia在src目录下创建stores文件夹(目前pinia还没有形成统一命名规范,因为pinia可以创建多个store,所以叫stores),在创建index文件作为入口文件


定义某个模块数据
store名称要保持唯一,也是devtools的依据
返回的函数命名规范是use加store的名称



三,state
操作state


四,getters使用

访问getters


五,actions使用


边栏推荐
- UnityShader入门学习(一)——GPU与Shader
- 最小费用最大流问题详解
- RecyclerView的高效使用第一节
- 蔚来杯2022牛客暑期多校训练营4
- 三角恒等变换公式
- element-plus虚拟表格virtual-list组件中是怎么实现清理lodash.memoize缓存的?
- c语言hello world代码(代码编程入门)
- Ubantu project 4: xshell, XFTP connected the virtual machine and set xshell copy and paste the shortcut
- 自动化测试如何创造业务价值?
- Trigonometric identity transformation formula
猜你喜欢
随机推荐
Excel快速对齐表格的中姓名(两个字姓名和三个字姓名对齐)
Architecture actual combat battalion module 8 message queue table structure design
Trigonometric identity transformation formula
浏览器自带的拾色器
Ubuntu Topic 5: Setting a Static IP Address
修改SQL语言实现Mysql 多表关联查询优化
Unity Shader入门精要学习——透明效果
NPM淘宝镜像(最新版本)于2021-11-21 16:53:52发布新版本npm镜像[通俗易懂]
Efficient use of RecyclerView Section 3
Destruction order of thread_local variables
/etc/profile、/etc/bashrc、~/.bash_profile、~/.bashrc 文件的作用
微信聊天记录中搜索红包
STM32(十)------- SPI通信
Efficient use of RecyclerView Section 1
乡村基冲刺港交所:5个月期内亏2224万 SIG与红杉中国是股东
基于最小二乘法和SVM从天气预报中预测太阳能发电量(Matlab代码实现)
使用 PyTorch 检测眼部疾病
RecyclerView的高效使用第一节
Word表格转到Excel中
基于极限学习机(ELM)进行多变量用电量预测(Matlab代码实现)









