fix: 启动动画卡顿
This commit is contained in:
@@ -17,7 +17,7 @@ function domReady(...args) {
|
||||
}
|
||||
|
||||
/** 插入 loading */
|
||||
function insertLoading() {
|
||||
function loadingBootstrap() {
|
||||
const loadingStyle = document.createElement('style');
|
||||
const loadingBox = document.createElement('div');
|
||||
|
||||
@@ -114,16 +114,16 @@ function insertLoading() {
|
||||
; (async function () {
|
||||
await domReady();
|
||||
|
||||
let _isCallClosePreloadLoading = false;
|
||||
const { removeLoading, appendLoading } = insertLoading();
|
||||
let _isCallRemoveLoading = false;
|
||||
const { removeLoading, appendLoading } = loadingBootstrap();
|
||||
|
||||
window.ClosePreloadLoading = () => {
|
||||
_isCallClosePreloadLoading = true;
|
||||
window.removeLoading = () => {
|
||||
_isCallRemoveLoading = true;
|
||||
removeLoading();
|
||||
};
|
||||
|
||||
// 5 秒超时自动关闭
|
||||
setTimeout(() => !_isCallClosePreloadLoading && removeLoading(), 4999);
|
||||
setTimeout(() => !_isCallRemoveLoading && removeLoading(), 4999);
|
||||
|
||||
appendLoading();
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user