This is really good, I used in Vue 3 so I had to change few things around like a $set to reactive wrapper.
One thing that I would suggest is to use computed property in your template instead of calling 'resultQuery()' directly. This way on any change your search will be run only once and not twice.
...
computed: {
searchResults: function() { return this.resultQuery(this.formData)}
}
....
template
...
resultQuery().length => searchResults.length
...
v-for="(value, index) in resultQuery()" to v-for='(value, index) in searchResults'
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is really good, I used in Vue 3 so I had to change few things around like a $set to reactive wrapper.
One thing that I would suggest is to use computed property in your template instead of calling 'resultQuery()' directly. This way on any change your search will be run only once and not twice.
...
computed: {
searchResults: function() { return this.resultQuery(this.formData)}
}
....
template
...
resultQuery().length => searchResults.length
...
v-for="(value, index) in resultQuery()" to v-for='(value, index) in searchResults'