Last active
August 12, 2020 13:40
-
-
Save Javison666/3efff8fe4ecbfe1f6708fc404a33cdde to your computer and use it in GitHub Desktop.
element-ui
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Message } from 'element-ui' | |
// 300m之后再弹loading | |
export function loadingMsg (message) { | |
let timer = null | |
let loading = null | |
timer = setTimeout(() => { | |
loading = Message({ | |
message, | |
type: 'info', | |
iconClass: 'el-icon-loading', | |
duration: 0 | |
}) | |
}, 300) | |
function CallbackFn () { } | |
CallbackFn.prototype.close = function () { | |
clearTimeout(timer) | |
if (loading) { | |
loading.close() | |
} | |
} | |
return new CallbackFn() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment