当前位置:网站首页>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 .
版权声明
本文为[:::::::]所创,转载请带上原文链接,感谢
边栏推荐
- H5 makes its own video player (JS Part 2)
- 怎么理解Python迭代器与生成器?
- 6.2 handleradapter adapter processor (in-depth analysis of SSM and project practice)
- 带你学习ES5中新增的方法
- 10 easy to use automated testing tools
- 6.5 request to view name translator (in-depth analysis of SSM and project practice)
- How to encapsulate distributed locks more elegantly
- 一篇文章带你了解SVG 渐变知识
- 阿里云Q2营收破纪录背后,云的打开方式正在重塑
- 助力金融科技创新发展,ATFX走在行业最前列
猜你喜欢
2019年的一个小目标,成为csdn的博客专家,纪念一下
如何玩转sortablejs-vuedraggable实现表单嵌套拖拽功能
Python自动化测试学习哪些知识?
[C / C + + 1] clion configuration and running C language
熬夜总结了报表自动化、数据可视化和挖掘的要点,和你想的不一样
Brief introduction and advantages and disadvantages of deepwalk model
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)
Flink的DataSource三部曲之二:内置connector
It's so embarrassing, fans broke ten thousand, used for a year!
100元扫货阿里云是怎样的体验?
随机推荐
6.1.1 handlermapping mapping processor (1) (in-depth analysis of SSM and project practice)
The practice of the architecture of Internet public opinion system
NLP model Bert: from introduction to mastery (2)
Every day we say we need to do performance optimization. What are we optimizing?
2018中国云厂商TOP5:阿里云、腾讯云、AWS、电信、联通 ...
华为云“四个可靠”的方法论
Natural language processing - BM25 commonly used in search
How long does it take you to work out an object-oriented programming interview question from Ali school?
Word segmentation, naming subject recognition, part of speech and grammatical analysis in natural language processing
前端基础牢记的一些操作-Github仓库管理
Nodejs crawler captures ancient books and records, a total of 16000 pages, experience summary and project sharing
From zero learning artificial intelligence, open the road of career planning!
Python Jieba segmentation (stuttering segmentation), extracting words, loading words, modifying word frequency, defining thesaurus
Swagger 3.0 天天刷屏,真的香嗎?
After reading this article, I understand a lot of webpack scaffolding
一篇文章带你了解CSS 渐变知识
Vue 3 responsive Foundation
如何将数据变成资产?吸引数据科学家
合约交易系统开发|智能合约交易平台搭建
Flink的DataSource三部曲之二:内置connector