1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
| import Vue from "vue";
| import { Loading } from "element-ui";
|
| let loadOn;
| let loadingCount = 0;
| function startLoading(target) {
| const options = {
| lock: true,
| text: "Loading...",
| spinner: "el-icon-loading",
| background: "rgba(0, 0, 0, 0.7)",
| target: document.querySelector(target),//target
| };
| loadOn = Loading.service(options);
| return loadOn;
| }
|
| function endLoading() {
| loadOn.close();
| }
|
| export function showFullScreenLoading(target) {
| if (loadingCount=== 0) {
| startLoading(target);
| }
| loadingCount++;
| }
| export function hideFullScreenLoading() {
| if (loadingCount<= 0) return;
| loadingCount--;
| if (loadingCount=== 0) {
| endLoading();
| }
| }
|
|