vue自定义进度条-防实时请求

         this.loading = true;
                this.loadingText = "转换中 0%";
                let seconds = 5;
                let timerTi = 0;
                timerTi = setInterval(() => {
                  seconds--;
                  if (seconds == 0) {
                    this.loadingText = "转换中 95%";
                  } else
                    this.loadingText =
                      "转换中 " + Math.floor(100 / (seconds + 1)) + "%";
                  if (seconds <= 0) {
                    clearInterval(timerTi);
                  }
                }, 1000);

你可能感兴趣的:(vue.js,elementui,前端)