mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-08 22:51:25 +08:00
showMessageBox 超时时间根据文本长度自动调整
This commit is contained in:
parent
0e48da299f
commit
35a68dec97
@ -84,9 +84,10 @@ export default {
|
|||||||
this.showUI(ConfirmBox, { message, title }, false, reslove);
|
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 === "success") icon = "positive";
|
||||||
if (icon === "error") icon = "negative";
|
if (icon === "error") icon = "negative";
|
||||||
|
if (!time) time = Math.max(message.toString().length * 120, 1000);
|
||||||
Notify.create({
|
Notify.create({
|
||||||
type: icon,
|
type: icon,
|
||||||
message: message,
|
message: message,
|
||||||
|
@ -138,7 +138,7 @@ interface quickcommandApi {
|
|||||||
* ```
|
* ```
|
||||||
* @param message 显示的消息内容
|
* @param message 显示的消息内容
|
||||||
* @param icon 图标,默认为 success
|
* @param icon 图标,默认为 success
|
||||||
* @param time 多少毫秒后消失,默认为 3000,当设为 0 时则需要手动点击关闭
|
* @param time 多少毫秒后消失,如不指定则根据文本长度自动调整,当设为 0 时则需要手动点击关闭
|
||||||
*/
|
*/
|
||||||
showMessageBox(
|
showMessageBox(
|
||||||
message: string,
|
message: string,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user