Files
2026-06-03 14:18:28 +08:00

14 lines
365 B
TypeScript

// 显示错误
import { ElNotification } from "element-plus";
export function showMsg(t: string, type = "error", isCatch = true, reason?: string, duration = 2000) {
ElNotification({
title: t,
type,
duration
});
if (isCatch && type != "success") {
throw Error(reason || t);
}
// if (isCatch && type != 'success') { return reason || t; }
}