showMessageBox 超时时间根据文本长度自动调整

This commit is contained in:
fofolee 2022-05-02 16:07:12 +08:00
parent 0e48da299f
commit 35a68dec97
2 changed files with 3 additions and 2 deletions

View File

@ -84,9 +84,10 @@ export default {
this.showUI(ConfirmBox, { message, title }, false, reslove);
}),
showMessageBox: (message, icon = "success", time = 3000) => {
showMessageBox: (message, icon = "success", time) => {
if (icon === "success") icon = "positive";
if (icon === "error") icon = "negative";
if (!time) time = Math.max(message.toString().length * 120, 1000);
Notify.create({
type: icon,
message: message,

View File

@ -138,7 +138,7 @@ interface quickcommandApi {
* ```
* @param message
* @param icon success
* @param time 3000 0
* @param time 0
*/
showMessageBox(
message: string,