gpt4 book ai didi

javascript - 当用户在 5 分钟后处于非事件状态时显示弹出窗口

转载 作者:行者123 更新时间:2023-11-30 09:18:55 25 4
gpt4 key购买 nike

<分区>

我试图在用户不活动 5 分钟时显示弹出窗口。

  timeout() {
setTimeout(() => this.openDialog(), 4000);
}
<h2 mat-dialog-title>Alert!</h2>
<mat-dialog-content class="mat-typography">
</mat-dialog-content>
<mat-dialog-actions align="end">
<button mat-button mat-dialog-close>Cancel</button>
<button mat-button [mat-dialog-close]="true"cdkFocusInitial>Ok</button>
</mat-dialog-actions>

在上面的代码中,this.openDialog() 对话框会在您打开页面 2 秒后显示。但是我想在用户不活动 5 分钟时显示弹出窗口。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com