当前位置:网站首页>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使用


边栏推荐
- DeepLab系列学习
- 安装Xshell并使用其进行Ymodem协议的串口传输
- Word表格转到Excel中
- Recommendation System - Recall Phase - 2013: DSSM (Twin Towers Model) [Embedding (Semantic Vector) Recall] [Microsoft]
- Efficient use of RecyclerView Section 2
- NC | 斯坦福申小涛等开发数据可重复分析计算框架TidyMass
- RecyclerView高效使用第二节
- 易驱线主控芯片对比(电动三轮电机90O瓦世纪通达)
- 工程力学复习资料
- Spark学习(3)-Spark环境搭建-Standalone
猜你喜欢

The paper manual becomes 3D animation in seconds, the latest research of Wu Jiajun of Stanford University, selected for ECCV 2022

Getting started with UnityShader (3) - Unity's Shader

QGIS 加载WMS数据,重新投影

Efficient use of RecyclerView Section 1

mongo进入报错

UnityShader入门学习(一)——GPU与Shader

UnityShader入门学习(三)——Unity的Shader

四象限时间管理有多好用?

Ubantu专题4:xshell、xftp连接接虚拟机以及设置xshell复制粘贴快捷键

Spark学习(2)-Spark环境搭建-Local
随机推荐
网线RJ45接口针脚[通俗易懂]
The role of /etc/profile, /etc/bashrc, ~/.bash_profile, ~/.bashrc files
Trigonometric identity transformation formula
英文语法-时与态
实现防抖与节流函数
R language moves time series data forward or backward (custom lag or lead period): use the lag function in the dplyr package to move the time series data forward by one day (set the parameter n to a p
Sentinel流量控制
Word表格转到Excel中
如何进行需求分析评审
RecyclerView的高效使用第一节
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
Synchronized和volatile 面试简单汇总
UnityShader入门学习(一)——GPU与Shader
Getting started with UnityShader (1) - GPU and Shader
[CUDA study notes] First acquaintance with CUDA
力扣:56. 合并区间
Message queue data storage MySQL table design
MySql总结
Synchronized and volatile interview brief summary
Efficient use of RecyclerView Section 3