Files
APP/utils/loading.js

42 lines
677 B
JavaScript
Raw Normal View History

2025-09-24 08:35:34 +08:00
// utils/loading.js
// 显示loading
2025-08-14 17:25:53 +08:00
export const showLoading = (ev,options) => {
if(!ev){
return;
2025-09-24 08:35:34 +08:00
}
let defaultTxt="请稍候...";
2025-08-14 17:25:53 +08:00
if(!options){
2025-09-24 08:35:34 +08:00
options={text:defaultTxt};
2025-08-15 16:39:00 +08:00
}
if(!options.text && options.title){
options.text=options.title;
2025-09-24 08:35:34 +08:00
}
2025-08-15 16:39:00 +08:00
if(!options.text){
2025-09-24 08:35:34 +08:00
options.text=defaultTxt;
2025-08-15 16:39:00 +08:00
}
ev.$refs.loading.show(options);
2025-09-24 08:35:34 +08:00
}
// 隐藏loading
2025-08-14 17:25:53 +08:00
export const hideLoading = (ev) => {
if(!ev){
return;
2025-09-24 08:35:34 +08:00
}
ev.$refs.loading.hide();
}
// 更新loading配置
2025-08-14 17:25:53 +08:00
export const updateLoading = (ev,options) => {
if(!ev){
return;
2025-09-24 08:35:34 +08:00
}
2025-08-14 17:25:53 +08:00
if(!options){
options={a:1};
2025-09-24 08:35:34 +08:00
}
ev.$refs.loading.update(options)
2025-08-14 17:25:53 +08:00
}