I'm currently working on implementing a search feature for my Nuxt Js front end. My goal is to have the input value cleared whenever the user hits enter to start the search process. Below is the code snippet showing my current method and markup.
JavaScript Method
methods: {
searchTag: function(event) {
var newtag = event.target.value;
this.tags.push({name: newtag});
}
}
Markup
<input type="text" placeholder="Search for tags..." v-on:keyup.enter="searchTag">
I attempted to use event.target.reset(); but unfortunately, it didn't work as expected. It seems like a simple task, yet I haven't been able to find a solution. Additionally, I prefer not to rely on JQuery or plain JavaScript for such a small feature since everything else in the application is already set up without them.
Thanks, Jamie