showMessageBox消息过长时进行截断

This commit is contained in:
fofolee 2022-06-01 10:27:54 +08:00
parent f51eb9d832
commit 827cd193a2

View File

@ -85,9 +85,11 @@ export default {
}),
showMessageBox: (message, icon = "success", time) => {
message = _.truncate(message, { length: 1200 });
if (icon === "success") icon = "positive";
if (icon === "error") icon = "negative";
if (!time) time = Math.max(message.toString().length * 120, 1000);
if (typeof time === "undefined")
time = Math.max(message.toString().length * 120, 1000);
Notify.create({
type: icon,
message: message,