<template></template>
<script setup>
import {ElLoading, ElMessage, ElMessageBox} from 'element-plus'

window.$message = () => {
  ElMessage.closeAll()
  return ElMessage
}
window.$box = ElMessageBox
let loading = null
window.$loading = () => {
  return {
    open: () => {
      loading = ElLoading.service({
        lock: true,
        text: '加载中...',
      })
    },
    close: () => {
      loading.close()
    },
  }
}
</script>
