diff --git a/data/navs.json b/data/navs.json index 77845c1..c7ed8f8 100644 --- a/data/navs.json +++ b/data/navs.json @@ -410,23 +410,23 @@ "href": "pages/tripartite/countup.html" }, { - "title": "okToastr.js", + "title": "okToastr", "href": "pages/tripartite/okToastr.html" }, { - "title": "okMd5.js", + "title": "okMd5", "href": "pages/tripartite/okMd5.html" }, { - "title": "okBarcode.js", + "title": "okBarcode", "href": "pages/tripartite/okBarcode.html" }, { - "title": "okNprogress.js", + "title": "okNprogress", "href": "pages/tripartite/okNprogress.html" }, { - "title": "okSweetalert2.js", + "title": "okSweetalert2", "href": "pages/tripartite/okSweetalert2.html" }, { diff --git a/pages/tripartite/okToastr.html b/pages/tripartite/okToastr.html index 125387e..6d2b432 100644 --- a/pages/tripartite/okToastr.html +++ b/pages/tripartite/okToastr.html @@ -8,19 +8,102 @@
+
+

toastr是非阻塞通知的JavaScript库

+
+
+layui.use(["okToastr"], function () {
+    // 引入okToastr
+    let okToastr = layui.okToastr;
+    // 是否显示关闭按钮
+    okToastr.options.closeButton = true;
+    // 回调函数
+    okToastr.options.onShown = function () {
+        console.log("hello");
+    }
+    okToastr.options.onHidden = function () {
+        console.log("goodbye");
+    }
+    okToastr.options.onclick = function () {
+        console.log("clicked");
+    }
+    okToastr.options.onCloseClick = function () {
+        console.log("close button clicked");
+    }
+    
+ // info + okToastr.info("ok-admin"); + // success + okToastr.success("ok-admin"); + // warning + okToastr.warning("ok-admin"); + // error + okToastr.error("ok-admin"); + // remove + okToastr.remove(); + // clear + okToastr.clear(); +}); +
+ + + + + +