当前位置:网站首页>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 .
版权声明
本文为[:::::::]所创,转载请带上原文链接,感谢
边栏推荐
- 5.4 static resource mapping
- Python download module to accelerate the implementation of recording
- [event center azure event hub] interpretation of error information found in event hub logs
- Natural language processing - wrong word recognition (based on Python) kenlm, pycorrector
- Aprelu: cross border application, adaptive relu | IEEE tie 2020 for machine fault detection
- 10 easy to use automated testing tools
- ES6学习笔记(五):轻松了解ES6的内置扩展对象
- axios学习笔记(二):轻松弄懂XHR的使用及如何封装简易axios
- 比特币一度突破14000美元,即将面临美国大选考验
- Serilog原始碼解析——使用方法
猜你喜欢
Linked blocking Queue Analysis of blocking queue
Summary of common algorithms of binary tree
一篇文章带你了解CSS3 背景知识
Calculation script for time series data
至联云解析:IPFS/Filecoin挖矿为什么这么难?
ES6学习笔记(五):轻松了解ES6的内置扩展对象
It's so embarrassing, fans broke ten thousand, used for a year!
In order to save money, I learned PHP in one day!
快快使用ModelArts,零基礎小白也能玩轉AI!
Do not understand UML class diagram? Take a look at this edition of rural love class diagram, a learn!
随机推荐
After reading this article, I understand a lot of webpack scaffolding
Word segmentation, naming subject recognition, part of speech and grammatical analysis in natural language processing
Mongodb (from 0 to 1), 11 days mongodb primary to intermediate advanced secret
ES6学习笔记(五):轻松了解ES6的内置扩展对象
PHP应用对接Justswap专用开发包【JustSwap.PHP】
加速「全民直播」洪流,如何攻克延时、卡顿、高并发难题?
6.4 viewresolver view parser (in-depth analysis of SSM and project practice)
Calculation script for time series data
What problems can clean architecture solve? - jbogard
I think it is necessary to write a general idempotent component
Classical dynamic programming: complete knapsack problem
Filecoin主网上线以来Filecoin矿机扇区密封到底是什么意思
Leetcode's ransom letter
在大规模 Kubernetes 集群上实现高 SLO 的方法
6.3 handlerexceptionresolver exception handling (in-depth analysis of SSM and project practice)
容联完成1.25亿美元F轮融资
How do the general bottom buried points do?
Summary of common string algorithms
快快使用ModelArts,零基礎小白也能玩轉AI!
Elasticsearch 第六篇:聚合統計查詢