After creating a couple of reusable components that include a slot for managing content and style, I started wondering if it's possible to pass an event handler to those components from within the template tag.
ReusableComponent
<a :href="hrefProps"> // The desired handler goes here
<slot></slot> // Renders plain text without HTML tags
</a>
Main Component
<reusable-component>
<template @click="sayHelloWorld">Hello World!</template> // Attempt that didn't work
</reusable-component>
I'm still trying to figure out how to make this work. Do I need to wrap them in at least one tag like this?
<template><a @click="sayHelloWorld"></a></template> // Will this solution make it work?