当前位置:网站首页>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 .
版权声明
本文为[:::::::]所创,转载请带上原文链接,感谢
边栏推荐
- Python3 e-learning case 4: writing web proxy
- xmppmini 專案詳解:一步一步從原理跟我學實用 xmpp 技術開發 4.字串解碼祕笈與訊息包
- Mongodb (from 0 to 1), 11 days mongodb primary to intermediate advanced secret
- 全球疫情加速互联网企业转型,区块链会是解药吗?
- Programmer introspection checklist
- 6.1.2 handlermapping mapping processor (2) (in-depth analysis of SSM and project practice)
- Just now, I popularized two unique skills of login to Xuemei
- JVM memory area and garbage collection
- Python + appium automatic operation wechat is enough
- Save the file directly to Google drive and download it back ten times faster
猜你喜欢
怎么理解Python迭代器与生成器?
hadoop 命令总结
中小微企业选择共享办公室怎么样?
关于Kubernetes 与 OAM 构建统一、标准化的应用管理平台知识!(附网盘链接)
vue-codemirror基本用法:实现搜索功能、代码折叠功能、获取编辑器值及时验证
100元扫货阿里云是怎样的体验?
Python Jieba segmentation (stuttering segmentation), extracting words, loading words, modifying word frequency, defining thesaurus
Don't go! Here is a note: picture and text to explain AQS, let's have a look at the source code of AQS (long text)
git rebase的時候捅婁子了,怎麼辦?線上等……
[C / C + + 1] clion configuration and running C language
随机推荐
Why do private enterprises do party building? ——Special subject study of geek state holding Party branch
[C / C + + 1] clion configuration and running C language
Installing the consult cluster
从海外进军中国,Rancher要执容器云市场牛耳 | 爱分析调研
至联云分享:IPFS/Filecoin值不值得投资?
Python crawler actual combat details: crawling home of pictures
What problems can clean architecture solve? - jbogard
Python Jieba segmentation (stuttering segmentation), extracting words, loading words, modifying word frequency, defining thesaurus
Brief introduction and advantages and disadvantages of deepwalk model
How do the general bottom buried points do?
Subordination judgment in structured data
每个前端工程师都应该懂的前端性能优化总结:
前端都应懂的入门基础-github基础
Aprelu: cross border application, adaptive relu | IEEE tie 2020 for machine fault detection
在大规模 Kubernetes 集群上实现高 SLO 的方法
Flink的DataSource三部曲之二:内置connector
Process analysis of Python authentication mechanism based on JWT
深度揭祕垃圾回收底層,這次讓你徹底弄懂她
Thoughts on interview of Ali CCO project team
Vue 3 responsive Foundation