在main.js中添加
/* 全局加载层Loading */
Vue.prototype.$fullPageLoading = (dom) => {
const loading = Loading.service({
lock: true,
text: '正在处理中...',
background: 'hsla(0,0%,100%,0)',
target: dom ? document.querySelector(dom) : document.body
})
return loading
}
进度条开启
this.$fullPageLoading()
进度条关闭
this.$fullPageLoading().close()