You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
477 B
25 lines
477 B
import { Loading } from 'element-ui'
|
|
|
|
let loading
|
|
let loadingCount = 0
|
|
|
|
const options = {
|
|
lock: true,
|
|
text: '正在加载',
|
|
spinner: 'el-icon-loading',
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
}
|
|
|
|
export function showLoading() {
|
|
if (loadingCount === 0) {
|
|
loading = Loading.service(options)
|
|
}
|
|
loadingCount++
|
|
}
|
|
export function hideLoading() {
|
|
if (loadingCount < 0) return
|
|
loadingCount--
|
|
if (loadingCount === 0) {
|
|
loading.close()
|
|
}
|
|
}
|
|
|