I want to make use one function for multiple component in vue-js. To do so i need to make two things dynamic - 1.ajax-url and 2. dataset holder for options. I read https://sagalbot.github.io/vue-select/docs/Advanced/Ajax.html as per this function working fine. i have following code-
<v-select :options="fieldSet[name].dataSet" :url="/user/autocomplete?term=" @search="onSearch">
<template slot="no-options">
<button class="btn btn-block">Add New Item</button>
</template>
</v-select>
onsearch method is as follows as given in above link -
// here search and load parameter gives searchText and spinner for UX
onSearch: function onSearch(search, loading) {
loading(true);
// this.search(loading, search, this);
// here i want to get options holder and ajax-url so that i can
// fetch data using ajax and assign to some dynamic variable (which is defined for particular field)
},
What i looked into is - Use dynamic AJAX URL for Vue Select2 wrapper component , but could not determine what to do for v-select.