An Interest In:
Web News this Week
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
March 28, 2022 08:46 am GMT
Original Link: https://dev.to/ccreusat/react-vue-and-svelte-comparing-the-basics-part-7-1m1p
React, Vue and Svelte: Comparing the basics - Part 7
Click Event in...
The use of the click directive is quite similar in these 3 frameworks.
Check it out
React
const handleClick = () => { alert('I was clicked!')}<button onClick={handleClick} className="button">Click me!</button>
Vue
const handleClick = () => { alert('I was clicked!')}<button @click="handleClick" class="button">Click me!</button>
Svelte
const handleClick = () => { alert('I was clicked!')}<button on:click={handleClick} class="button">Click me!</button>
Original Link: https://dev.to/ccreusat/react-vue-and-svelte-comparing-the-basics-part-7-1m1p
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To