Comments (6)
@xereda code is ES6. @Dolce code is vanilla JS. Since not everyone (yet) is using ES6, I think vanilla JS for documentation is still better than a language that yet need to be transpiled to work.
Using vanilla JS I can get @Dolce example working with ease.
from izitoast.
What is incorrect? Is not working?
from izitoast.
It's working perfectly. I just thought it might create an inconsistency in the future. A javascript object pattern can be considered in the suggestion below.
buttons: [
{ '<button>Ok</button>': (instance, toast) => { alert("Hello world!") } },
{ '<button>Close</button>': (instance, toast) => {
instance.hide({
transitionOut: 'fadeOutUp',
onClose: (instance, toast, closedBy) => {
console.info('closedBy: ' + closedBy) //btn2
}
}, toast, 'close', 'btn2')
}
}
},
Regardless of anything, its great job!
from izitoast.
Thanks for the suggestion @xereda, I will be making some improvements soon.
from izitoast.
Hello @xereda, I'm working on this latest version now. Would you like to contribute by making a Commit with a better pattern to the buttons? Thanks!
from izitoast.
@chekovsky Its true! Tks for feedback.
from izitoast.
Related Issues (20)
- For future googlers: Working with Vue.js
- IziToast is not defined in php HOT 1
- The icon is stretched on the Chrome version 86.0.4240.80
- https://izitoast.marcelodolza.com/ HOT 2
- Dynamic message HOT 2
- When you click close, you can perform an operation. When you close automatically, do not perform the previous operation HOT 8
- Button HTML HOT 1
- Documentation is unavailable HOT 2
- Cannot use FontAwesome HOT 2
- Need Support for Svelte Framework HOT 1
- XSS vulnerability
- Update Needed Soon
- progressbar stops for a few seconds
- Is it possible to make a button pressed when the enter key is pressed?
- InstallTrigger is obsolete and will be removed HOT 1
- Typo in documentation
- iconUrl does not exist in type IziToastSettings
- Suggestion HOT 1
- I would like to ask you how to add select and button to the inputs attribute? HOT 3
- On Ajax send, change an option of current instance
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from izitoast.