File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -83,14 +83,16 @@ You can provide a single button within an object, or an array of buttons.
8383
8484### All Options
8585``` javascript
86- new SimpleToast ({
86+ const toast = new SimpleToast ({
8787 title: ' ' ,
8888 text: ' ' ,
8989 buttons: [... button] || {
9090 text: ' ' ,
9191 className: ' ' ,
9292 css: {},
93- onclick () {},
93+ onclick () {
94+ // this; // toast reference
95+ },
9496 },
9597 footer: ' ' ,
9698 className: ' ' ,
@@ -103,6 +105,11 @@ new SimpleToast({
103105 onClose (reason , toast ) {},
104106});
105107
108+ // Methods on toast
109+ toast .setText (newText); // Change text to newText
110+ toast .exists (); // Does toast still exist?
111+ toast .close (reason); // Close toast for optional reason
112+
106113SimpleToast .version ; // Version in number form
107114SimpleToast .versionString ; // Readable string of version
108115SimpleToast .count (); // Numer of toasts open
You can’t perform that action at this time.
0 commit comments