Skip to content

Instantly share code, notes, and snippets.

@Javison666
Last active August 12, 2020 13:40
Show Gist options
  • Save Javison666/3efff8fe4ecbfe1f6708fc404a33cdde to your computer and use it in GitHub Desktop.
Save Javison666/3efff8fe4ecbfe1f6708fc404a33cdde to your computer and use it in GitHub Desktop.
element-ui
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