当前位置:网站首页>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 .
版权声明
本文为[:::::::]所创,转载请带上原文链接,感谢
边栏推荐
- [event center azure event hub] interpretation of error information found in event hub logs
- Calculation script for time series data
- Didi elasticsearch cluster cross version upgrade and platform reconfiguration
- 嘗試從零開始構建我的商城 (二) :使用JWT保護我們的資訊保安,完善Swagger配置
- 如何玩转sortablejs-vuedraggable实现表单嵌套拖拽功能
- Using Es5 to realize the class of ES6
- Let the front-end siege division develop independently from the back-end: Mock.js
- 6.5 request to view name translator (in-depth analysis of SSM and project practice)
- What is the side effect free method? How to name it? - Mario
- Leetcode's ransom letter
猜你喜欢
Did you blog today?
Use of vuepress
It's so embarrassing, fans broke ten thousand, used for a year!
合约交易系统开发|智能合约交易平台搭建
Word segmentation, naming subject recognition, part of speech and grammatical analysis in natural language processing
从海外进军中国,Rancher要执容器云市场牛耳 | 爱分析调研
在大规模 Kubernetes 集群上实现高 SLO 的方法
一篇文章教会你使用HTML5 SVG 标签
华为云“四个可靠”的方法论
Arrangement of basic knowledge points
随机推荐
Linked blocking Queue Analysis of blocking queue
一篇文章带你了解CSS 分页实例
6.1.2 handlermapping mapping processor (2) (in-depth analysis of SSM and project practice)
“颜值经济”的野望:华熙生物净利率六连降,收购案遭上交所问询
至联云解析:IPFS/Filecoin挖矿为什么这么难?
6.5 request to view name translator (in-depth analysis of SSM and project practice)
ES6 essence:
在大规模 Kubernetes 集群上实现高 SLO 的方法
阿里云Q2营收破纪录背后,云的打开方式正在重塑
深度揭祕垃圾回收底層,這次讓你徹底弄懂她
Brief introduction of TF flags
一篇文章教会你使用HTML5 SVG 标签
华为云“四个可靠”的方法论
The difference between Es5 class and ES6 class
From zero learning artificial intelligence, open the road of career planning!
Let the front-end siege division develop independently from the back-end: Mock.js
從小公司進入大廠,我都做對了哪些事?
比特币一度突破14000美元,即将面临美国大选考验
Relationship between business policies, business rules, business processes and business master data - modern analysis
I'm afraid that the spread sequence calculation of arbitrage strategy is not as simple as you think