errorMsg.ts 290 B

123456789101112131415161718
  1. import { ElMessage } from 'element-plus'
  2. const STOP = 2000
  3. let showIng = false
  4. export const openErrorMsg = (msg: string) => {
  5. if (showIng) return;
  6. showIng = true
  7. ElMessage({
  8. type: 'error',
  9. duration: STOP,
  10. message: msg
  11. });
  12. setTimeout(() => showIng = false, STOP)
  13. }