42 lines
636 B
JavaScript
42 lines
636 B
JavaScript
// utils/loading.js
|
|
|
|
// 显示loading
|
|
export const showLoading = (ev,options) => {
|
|
if(!ev){
|
|
return;
|
|
}
|
|
let defaultTxt="请稍候...";
|
|
if(!options){
|
|
options={text:defaultTxt};
|
|
}
|
|
if(!options.text && options.title){
|
|
options.text=options.title;
|
|
}
|
|
if(!options.text){
|
|
options.text=defaultTxt;
|
|
}
|
|
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)
|
|
|
|
} |