Files
APP/utils/loading.js

42 lines
636 B
JavaScript
Raw Permalink Normal View History

2025-08-27 10:32:13 +08:00
// utils/loading.js
// 显示loading
export const showLoading = (ev,options) => {
if(!ev){
return;
}
2025-08-28 14:05:06 +08:00
let defaultTxt="请稍候...";
2025-08-27 10:32:13 +08:00
if(!options){
2025-08-28 14:05:06 +08:00
options={text:defaultTxt};
2025-08-27 10:32:13 +08:00
}
if(!options.text && options.title){
options.text=options.title;
}
if(!options.text){
2025-08-28 14:05:06 +08:00
options.text=defaultTxt;
2025-08-27 10:32:13 +08:00
}
ev.$refs.loading.show(options);
}
// 隐藏loading
export const hideLoading = (ev) => {
if(!ev){
return;
}
ev.$refs.loading.hide();
}
// 更新loading配置
export const updateLoading = (ev,options) => {
if(!ev){
return;
}
if(!options){
options={a:1};
}
ev.$refs.loading.update(options)
}