当前位置:网站首页>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使用
边栏推荐
- Female service community product design
- Destruction order of thread_local variables
- 《微信小程序-进阶篇》Lin-ui组件库源码分析-Icon组件
- Prometheus之node_exporter性能监控信息采集含义
- /etc/profile、/etc/bashrc、~/.bash_profile、~/.bashrc 文件的作用
- 华医网冲刺港股:5个月亏2976万 红杉与姚文彬是股东
- Node实现数据加密
- LeetCode二叉树系列——222.完全二叉树的节点个数
- R language ggplot2 visualization: use the ggboxplot function of the ggpubr package to visualize the box plot, use the font function to customize the font size, color, style (bold, italic) of the legen
- R语言的画图代码及差异性分析[通俗易懂]
猜你喜欢
为什么黑客领域几乎一片男生?
LeetCode二叉树系列——226.翻转二叉树
Sentinel热点参数限流
"Listen to me, thank you" can be said in ancient poetry?Tsinghua University has developed an artifact of "Searching Sentences According to Meaning", which can search for the famous sayings you want wi
NC | 斯坦福申小涛等开发数据可重复分析计算框架TidyMass
abaqus find contact pairs报错:surface name is already in use
定时器的类型
「秋招系列」MySQL面试核心25问(附答案)
浏览器自带的拾色器
The meaning of node_exporter performance monitoring information collection in Prometheus
随机推荐
R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化箱图、使用font函数自定义图例标题文本(legend.title)字体的大小、颜色、样式(粗体、斜体)
Node实现数据加密
RecyclerView的高效使用第一节
架构实战营模块8消息队列表结构设计
SQL、HQL、JPQL 到底有什么区别
2021 OWASP TOP 10 Vulnerability Guide
Network cable RJ45 interface pins [easy to understand]
"Listen to me, thank you" can be said in ancient poetry?Tsinghua University has developed an artifact of "Searching Sentences According to Meaning", which can search for the famous sayings you want wi
实现防抖与节流函数
Unity Shader入门精要学习——透明效果
工程水文学复习资料
LeetCode二叉树系列——110.平衡二叉树
格林美瑞交所IPO:募资3.8亿美元 更多中国企业将赴欧洲上市
TRACE32——C源码关联
c语言hello world代码(代码编程入门)
四象限时间管理有多好用?
乡村基冲刺港交所:5个月期内亏2224万 SIG与红杉中国是股东
TRACE32——常用操作
Destruction order of thread_local variables
使用 Chainlink Keepers 实现智能合约函数的自动化执行