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


边栏推荐
猜你喜欢
随机推荐
Advanced Mathematics - Commonly Used Indefinite Integral Formulas
c语言hello world代码(代码编程入门)
leetcode303 Weekly Match Replay
Excel quickly aligns the middle name of the table (two-word name and three-word name alignment)
大健云仓冲刺美股:增营收反减利润 京东与DCM是股东
Nuget package and upload tutorial
763.划分字母区间——之打开新世界
乡村基冲刺港交所:5个月期内亏2224万 SIG与红杉中国是股东
格林美瑞交所IPO:募资3.8亿美元 更多中国企业将赴欧洲上市
小试牛刀:Go 反射帮我把 Excel 转成 Struct
LeetCode二叉树系列——226.翻转二叉树
四象限时间管理有多好用?
Recommendation System - Recall Phase - 2013: DSSM (Twin Towers Model) [Embedding (Semantic Vector) Recall] [Microsoft]
charles进行弱网测试(app弱网测试怎么做)
为什么黑客领域几乎一片男生?
消息队列消息数据存储MySQL表设计
【CUDA学习笔记】初识CUDA
Synchronized and volatile interview brief summary
思路迪医药冲刺港股:5个月亏2.9亿 泰格医药与先声药业是股东
The role of /etc/profile, /etc/bashrc, ~/.bash_profile, ~/.bashrc files









