loading.ts 381 B

1234567891011121314
  1. import pMinDelay from 'p-min-delay'
  2. const el = document.getElementById('loading')
  3. export const close = async () => {
  4. // loading 最少等待300ms
  5. await pMinDelay(Promise.resolve(), 300)
  6. el?.classList.remove('show')
  7. // 同时关闭系统升级提示
  8. document.getElementById('update')?.classList.remove('show')
  9. }
  10. export const open = () => {
  11. el?.classList.add('show')
  12. }