Is there a way to pass data from child to parent without creating a method for assigning the value? I want to be able to assign it directly in the template.
This is my current code:
Child
<h1 @click="$emit('title', 'Home')" />
Parent
<div @title="onTitleChange" />
onTitleChange(newTitle) {
this.title = newTitle;
}
I am looking for something like this:
Child
<h1 @click="$emit('title', 'Home')" />
Parent
<div @title="title = value" />