I am currently dealing with a functioning example of vue-multiselect. Despite its functionality, there are two persistent issues that need addressing.
- One problem arises when attempting to remove an option by clicking the x button, instead of actually removing the option, it duplicates it.
- Another issue is that the loading spinner fails to disappear even after resetting the isLoading variable to false.
For a visual demonstration, refer to the example provided at: https://codepen.io/TheDevCoder/pen/bGVbGOG
Markup
<multiselect
v-model="value"
id="ajax"
label="full_name"
:options="store"
:multiple="true"
:loading="isLoading"
:internal-search="false"
@search-change="getData"
>
</multiselect>
Script
getData(query){
this.isLoading = true;
if(query.length > 0){
axios.get(`https://api.github.com/search/repositories?q=${escape(query)}`)
.then((res) => {
this.store = res.data.items;
this.isLoading = false;
})
.catch((error) => {
console.log(error);
this.isLoading = false;
});
}
}