当前位置:网站首页>11 pinia use
11 pinia use
2022-07-31 15:12:00 【It's a cloud!】
One, the difference between pinia and vuex

Second, use
npm i piniaCreate a stores folder in the src directory (pinia has not yet formed a unified naming convention, because pinia can create multiple stores, so it is called stores), and create an index file as an entry file


Define a certain module data
The name of the store must be unique, which is also the basis of devtools
The returned function naming convention is the name of use plus store



Three, state
Operation state

Four, getters use

Access getters


Five, actions use


边栏推荐
- 工程流体力学复习
- 华医网冲刺港股:5个月亏2976万 红杉与姚文彬是股东
- How to clean up the lodash.memoize cache in the element-plus virtual table virtual-list component?
- 数据库的范式(第一范式,第二范式,第三范式,BCNF范式)「建议收藏」
- org.apache.jasperException(could not initialize class org)
- 如何进行需求分析评审
- Getting started with UnityShader (3) - Unity's Shader
- TRACE32 - C source code association
- 双边滤波加速「建议收藏」
- 基于最小二乘法和SVM从天气预报中预测太阳能发电量(Matlab代码实现)
猜你喜欢

LeetCode二叉树系列——110.平衡二叉树

leetcode303场周赛复盘

NC | 斯坦福申小涛等开发数据可重复分析计算框架TidyMass

名创优品斥资6.95亿购买创始人叶国富所持办公楼股权

11 pinia使用

Introductory UnityShader learning (2) - the rendering pipeline

使用 PyTorch 检测眼部疾病

OpenShift 4 - Deploy Redis Cluster with Operator

最小费用最大流问题详解

The paper manual becomes 3D animation in seconds, the latest research of Wu Jiajun of Stanford University, selected for ECCV 2022
随机推荐
[CUDA study notes] First acquaintance with CUDA
7、常见面试口语提问问题汇总
DBeaver连接MySQL 8.x时Public Key Retrieval is not allowed 错误解决
R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化分组箱图、使用ggpar函数改变图形化参数(legend、修改可视化图像的图例在整图中的位置)
WeChat chat record search in a red envelope
OpenShift 4 - Customize RHACS security policies to prevent production clusters from using high-risk registry
乡村基冲刺港交所:5个月期内亏2224万 SIG与红杉中国是股东
leetcode303 Weekly Match Replay
Ubantu专题4:xshell、xftp连接接虚拟机以及设置xshell复制粘贴快捷键
R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化箱图、使用font函数自定义图例标题文本(legend.title)字体的大小、颜色、样式(粗体、斜体)
c语言hello world代码(代码编程入门)
看交互设计如何集成到Scrum敏捷流程中
Network cable RJ45 interface pins [easy to understand]
The R language ggstatsplot package ggbarstats function visualizes bar charts, and adds hypothesis test results (including sample number, statistics, effect size and its confidence interval, significan
json到底是什么(c# json)
RecyclerView的高效使用第一节
How to clean up the lodash.memoize cache in the element-plus virtual table virtual-list component?
格林美瑞交所IPO:募资3.8亿美元 更多中国企业将赴欧洲上市
OpenCV测量物体的尺寸技能 get~
Message queue data storage MySQL table design