Complete the code to pass the event object to the handler.
<template> <button @click="handleClick([1])">Click me</button> </template> <script setup> function handleClick(event) { console.log(event.type) } </script>
In Vue, to pass the native event object to a handler, use $event.
Complete the code to pass a custom argument '42' to the handler.
<template> <button @click="handleClick([1])">Click me</button> </template> <script setup> function handleClick(id) { console.log(id) } </script>
To pass a number argument to a handler, just write the number without quotes.
Fix the error in passing both event and a custom argument to the handler.
<template> <button @click="handleClick([1], 5)">Click me</button> </template> <script setup> function handleClick(event, number) { console.log(event.type, number) } </script>
Use $event to pass the native event object as the first argument.
Fill both blanks to pass event and a custom message to the handler.
<template> <button @click="handleClick([1], [2])">Click me</button> </template> <script setup> function handleClick(event, message) { console.log(event.type, message) } </script>
Pass $event for the event and a string with quotes for the message.
Fill all three blanks to pass event, id, and a flag to the handler.
<template> <button @click="handleClick([1], [2], [3])">Click me</button> </template> <script setup> function handleClick(event, id, flag) { console.log(event.type, id, flag) } </script>
Pass $event for the event, a number for id, and a boolean for flag.
