1、定义Loading
import { Loading} from 'element-ui'; let loading = null;
2、请求之前拦截中启动loading
axios.interceptors.request.use(config => { //全局加载,请求之前发送loading loading = Loading.service({ lock: true, text: 'Loading', spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0.7)' }); return config; });
3、响应拦截器即异常处理中关闭loading
axios.interceptors.response.use((response, config) => { loading.close(); return response })
vue安装axios脚手架报“ ./node_modules/axios/lib/core/mergeConfig.js”错误解决方法
上面是“vuejs axios全局封装loading加载”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_106.html
workflows工作流
一盒用五颜六色的食材烹制的热气腾腾的寿司
骨骼般的恶魔修女ComfyUI工作流
一个红头发明亮眼睛的漂亮女人
一只由粉色水晶与羽毛组成的巨型高跟鞋
一只竹节虫ComfyUI工作流
晚上樱花狐狸ComfyUI工作流
在白雪覆盖的广阔平原上两只可爱的小猫
一个孤独的斗篷人物站在一座巨大的雕塑旁
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!