I'm a newbie in VueJS and do not have experience enough to handle this function.
So I create a question for asking (The question may be duplicated).
For example I used computed
to handle main filter/search function
computed: {
filteredProducts: function () {
return this.products.filter(product => product.name.includes(this.filter.name));
}
}
Next step, I render list of products with v-for
directive, using filteredProducts
<div v-for="product in filteredProducts" :key="product.id">
<input type="text" v-model="product.name" />
</div>
I have also an other text box, user can typing for searching by name of products
<input type="text" v-model="filter.name" />
By typing into search input, list of products is re-rendering properly.
The problem occurs when I try to remove some characters from Product name input, then the input was disappeared from the list.
What is the best way to keep the input appear on editing?