Commit f321827a authored by Mahëd Benzerga's avatar Mahëd Benzerga
Browse files

Autocomplete en mode dropdown

parent fcc6b4cc
<template>
<div class="autocomplete">
<label>
<span class="is-text is-semi-bold">
{{ label ? label : placeholder }}
</span>
<text-field class="is-fullwidth is-mb-05" :placeholder="placeholder" v-model="filterInput"></text-field>
</label>
<b-dropdown v-model="selected" aria-role="list" ref="dropdown" mobile-modal="false">
<b-dropdown v-model="selected" aria-role="list" ref="dropdown" :mobile-modal="false">
<template slot="trigger">
<label>
<span class="is-text is-semi-bold">
{{ label ? label : placeholder }}
</span>
<text-field class="is-fullwidth is-mb-05" :placeholder="placeholder" v-model="filterInput"></text-field>
</label>
</template>
<template v-if="!items.length && !selected">
<b-dropdown-item>
Aucun résultat
......
......@@ -50,9 +50,9 @@ export default {
},
computed: {
filteredAcademies() {
return this.academies.filter((academie) => {
return this.input !== '' ? this.academies.filter((academie) => {
return academie.name.toLowerCase().indexOf(this.input.toLowerCase()) !== -1
})
}) : this.academies
},
isShown: {
get() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment