当前位置:网站首页>Five vuex plug-ins for your next vuejs project
Five vuex plug-ins for your next vuejs project
2020-11-06 01:23:00 【:::::::】
original text :5 Vuex Plugins For Your Next VueJS Project author :Anthony Gore
Use Vuex To manage Vue The state of , There are many good reasons . One of them is , adopt Vuex Plug ins can easily extend some cool features .Vuex Developers in the community have created a large number of free plug-ins for you to use , There are many functions you can imagine , There are also features you may not have thought of .
In this paper , Will show you 5 A feature , You can go through Vuex Plug ins are easily added to the next project .
- State persistence
- Sync tab 、 window
- Language localization
- Manage multiple load states
- Cache operations
1. State persistence
vuex-persistedstate Use the browser's local storage ( local storage ) To state ( state ) persist . This means that refreshing the page or closing the tab will not delete your data .
A good example is the shopping cart : If a user accidentally closes a tag , They can reopen and go back to the state of the previous page .
2. Sync tab 、 window
vuex-shared-mutations Status can be synchronized between different tabs . It passes through mutation
Save state to local storage (local storage) To achieve . tab 、 When the content in the window is updated, the save event is triggered , Call again mutation
, To keep the state synchronized .
3. Language localization
vuex-i18n Allows you to easily store content in multiple languages . Make it easier for your app to switch languages .
One cool feature is that you can store strings with tags , such as "Hello {name}, this is your Vue.js app."
. All translations will use the same string where they are marked .
4. Manage multiple load states
vuex-loading Helps you manage multiple load states in your application . This plug-in is suitable for real-time applications with frequent and complex state changes .
5. Cache operations
vuex-cache Can be cached Vuex Of action
. for example , If you retrieve data from the server , The plug-in will call this for the first time action
Cache results when , And then after that dispatch
in , Return the cached value directly . It's also easy to clear the cache if necessary .
Welcome to the comments below , Write down your favorite Vuex plug-in unit !
Participation of this paper Tencent cloud media sharing plan , You are welcome to join us , share .
版权声明
本文为[:::::::]所创,转载请带上原文链接,感谢
边栏推荐
- vue任意关系组件通信与跨组件监听状态 vue-communication
- 5.5 controlleradvice notes - SSM in depth analysis and project practice
- 阿里云Q2营收破纪录背后,云的打开方式正在重塑
- Network security engineer Demo: the original * * is to get your computer administrator rights! 【***】
- NLP model Bert: from introduction to mastery (1)
- ES6学习笔记(四):教你轻松搞懂ES6的新增语法
- Common algorithm interview has been out! Machine learning algorithm interview - KDnuggets
- 基於MVC的RESTFul風格API實戰
- Save the file directly to Google drive and download it back ten times faster
- 如何将数据变成资产?吸引数据科学家
猜你喜欢
关于Kubernetes 与 OAM 构建统一、标准化的应用管理平台知识!(附网盘链接)
Computer TCP / IP interview 10 even asked, how many can you withstand?
数字城市响应相关国家政策大力发展数字孪生平台的建设
vue-codemirror基本用法:实现搜索功能、代码折叠功能、获取编辑器值及时验证
What is the side effect free method? How to name it? - Mario
IPFS/Filecoin合法性:保护个人隐私不被泄露
Arrangement of basic knowledge points
Windows 10 tensorflow (2) regression analysis of principles, deep learning framework (gradient descent method to solve regression parameters)
前端基础牢记的一些操作-Github仓库管理
Want to do read-write separation, give you some small experience
随机推荐
Skywalking series blog 2-skywalking using
Using Es5 to realize the class of ES6
Serilog原始碼解析——使用方法
Vue 3 responsive Foundation
Deep understanding of common methods of JS array
在大规模 Kubernetes 集群上实现高 SLO 的方法
前端都应懂的入门基础-github基础
Installing the consult cluster
容联完成1.25亿美元F轮融资
How to encapsulate distributed locks more elegantly
[event center azure event hub] interpretation of error information found in event hub logs
Face to face Manual Chapter 16: explanation and implementation of fair lock of code peasant association lock and reentrantlock
Flink的DataSource三部曲之二:内置connector
OPTIMIZER_ Trace details
华为云“四个可靠”的方法论
Filecoin的经济模型与未来价值是如何支撑FIL币价格破千的
The choice of enterprise database is usually decided by the system architect - the newstack
Why do private enterprises do party building? ——Special subject study of geek state holding Party branch
xmppmini 專案詳解:一步一步從原理跟我學實用 xmpp 技術開發 4.字串解碼祕笈與訊息包
Swagger 3.0 天天刷屏,真的香嗎?