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