I m using the plugin Vue - Multiselect Js ( Github )
I currently have same code as in the Ajax example except my research api return me more data than Multiselect expect.
import Multiselect from 'vue-multiselect'
import { ajaxFindCountry } from './countriesApi'
export default {
components: {
Multiselect
},
data () {
return {
selectedCountries: [],
countries: [],
isLoading: false
}
},
methods: {
limitText (count) {
return `and ${count} other countries`
},
asyncFind (query) {
this.isLoading = true
ajaxFindCountry(query).then(response => {
this.countries = response
this.isLoading = false
})
},
clearAll () {
this.selectedCountries = []
}
}
}
When I request "Hello world" to the Api, it can return "World hello" too, because it match any words (not only the successives chars).
Like in the example if you search barbuda you can found Antigua and Barbuda
And if that not perfecly match (just adding space) Antigua and Barbuda option is hidden. (I know is not my API so options are not exactly same but in practice that my current result)
Is it possible to don't have exact same match between options and search ?
As mentioned in the example and docs, you can use :internal-search="false" prop on vue-multiselect component to disable the internal filtering logic.
By doing so, options will not be filtered anymore by the component internally and if required you can write your own custom logic to filter options.