当前位置:网站首页>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 .
版权声明
本文为[:::::::]所创,转载请带上原文链接,感谢
边栏推荐
- 2018中国云厂商TOP5:阿里云、腾讯云、AWS、电信、联通 ...
- Keyboard entry lottery random draw
- 5.4 static resource mapping
- [event center azure event hub] interpretation of error information found in event hub logs
- 加速「全民直播」洪流,如何攻克延时、卡顿、高并发难题?
- Group count - word length
- 全球疫情加速互联网企业转型,区块链会是解药吗?
- NLP model Bert: from introduction to mastery (2)
- Arrangement of basic knowledge points
- 一篇文章带你了解CSS3 背景知识
猜你喜欢
Summary of common algorithms of binary tree
怎么理解Python迭代器与生成器?
Examples of unconventional aggregation
一篇文章带你了解CSS 分页实例
Use of vuepress
Character string and memory operation function in C language
Computer TCP / IP interview 10 even asked, how many can you withstand?
[JMeter] two ways to realize interface Association: regular representation extractor and JSON extractor
“颜值经济”的野望:华熙生物净利率六连降,收购案遭上交所问询
至联云分享:IPFS/Filecoin值不值得投资?
随机推荐
How long does it take you to work out an object-oriented programming interview question from Ali school?
PN8162 20W PD快充芯片,PD快充充电器方案
使用 Iceberg on Kubernetes 打造新一代云原生数据湖
合约交易系统开发|智能合约交易平台搭建
至联云分享:IPFS/Filecoin值不值得投资?
JVM memory area and garbage collection
[JMeter] two ways to realize interface Association: regular representation extractor and JSON extractor
The choice of enterprise database is usually decided by the system architect - the newstack
Keyboard entry lottery random draw
Network security engineer Demo: the original * * is to get your computer administrator rights! 【***】
数据产品不就是报表吗?大错特错!这分类里有大学问
Python + appium automatic operation wechat is enough
Skywalking series blog 2-skywalking using
How to select the evaluation index of classification model
Brief introduction of TF flags
Summary of common algorithms of binary tree
Word segmentation, naming subject recognition, part of speech and grammatical analysis in natural language processing
Python crawler actual combat details: crawling home of pictures
前端工程师需要懂的前端面试题(c s s方面)总结(二)
從小公司進入大廠,我都做對了哪些事?