How to achieve loading effect in vue axios interceptor?

to achieve the effect, the loading icon is displayed on the page when pending is requested:

clipboard.png

clipboard.png

preliminary experiment, hoping to have a public vuex, and then merge the store of each single page with this common store,axios interceptor setting axiosing=true every time the request is initiated, and axiosing=false

after the request ends.

problem, but what about the public vuex? Or is there any other way to achieve this effect? Thank you

Mar.02,2021

vuex are all public, but private ones will not be used.


axios interceptor do it: in request processing axios.interceptors.request, open, in axios.interceptors.response response processing close, deals with requested pages, and static pages do not need to be a loading.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4643b-44329.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4643b-44329.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?