14 lines
365 B
TypeScript
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; }
|
|
}
|