toastr 提示框 相较于传统的 alert ,样式漂亮的多。
导包之后,只需要写上如下的配置信息:
//配置提示框的信息
toastr.options.positionClass = "toast-top-full-width";//显示信息的位置
toastr.options.onclick = null;//是否为可点击
toastr.options.showDuration = "300";//设置显示动作时间
toastr.options.hideDuration = "100"//设置隐藏动作时间
toastr.options.timeOut = "1000"//设置隐藏动作时间
当想让其弹出时,则只需要如下语句:
//弹出提示框
toastr.success('打卡成功,您已迟到!');