import { nextTick } from 'vue' import '/@/styles/loading.scss' export const loading = { show: () => { const bodys: Element = document.body const div = document.createElement('div') div.className = 'block-loading' div.innerHTML = `
` bodys.insertBefore(div, bodys.childNodes[0]) }, hide: () => { nextTick(() => { setTimeout(() => { const el = document.querySelector('.block-loading') el && el.parentNode?.removeChild(el) }, 1000) }) }, }