0👍
Assuming that invProducts
is an array of product objects and each product object has a product_name
property, try this snippet.
<v-select @input="selectChange()" :label="product_name" :options="invProducts" v-model="selectedProduct">
</v-select>
Create a new data property called selectedProduct
and bind it to the vue-select component. So, whenever the selection in the vue-select changes, the value of selectedProduct
also changes. In addition to this, @input
event can be used to trigger a method in your component. You can get the selected product in that method and do further actions within that event listener.
methods: {
selectChange : function(){
console.log(this.selectedProduct);
//do futher processing
}
- [Vuejs]-“blocked by CORS policy” error with https://streamlabs.com/api/v1.0 endpoint
- [Vuejs]-How to nest components in cdn setup vue.js project
Source:stackexchange.com