hplus(h+) toastr通知

引入js、css

依赖jq,该js必须写在 toastr.js 的上面

<script src="/js/jquery.min.js"></script>
<script src="js/plugins/toastr/toastr.min.js"></script>

要引入 css样式文件

<link href="/css/plugins/toastr/toastr.min.css" rel="stylesheet">

找到样式

通过 hplus-master/index.html 页面,找到你要的样式

代码

从上图窗口中赋值选项

toastr.options = {
    "closeButton": true,
    "debug": false,
    "progressBar": false,
    "positionClass": "toast-top-center",
    "onclick": null,
    "showDuration": "10",
    "hideDuration": "1000",
    "timeOut": "2000",
    "extendedTimeOut": "100",
    "showEasing": "swing",
    "hideEasing": "linear",
    "showMethod": "fadeIn",
    "hideMethod": "fadeOut"
}

显示:

toastr.error("错误");
toastr.success("成功")
toastr.warning("失败")
toastr.info("你好")

参考:
https://cloud.tencent.com/developer/article/2219519


原文出处:https://malaoshi.top/show_1IX6En3uIP3k.html