on ajoute l'autocomplete dans le select

This commit is contained in:
Christophe 2021-03-17 22:37:12 +01:00
parent f9a3d44193
commit e3845cc3a7
2 changed files with 48 additions and 2 deletions

View file

@ -210,6 +210,8 @@ let monTableau = {
vuebloc: '',
model: [],
options: ['Jest', 'Mocha', 'Selenium', 'Puppeteer', 'Jasmine', 'Karma'],
searchInputHead: '',
searchInputVal: '',
};
},
mounted() {
@ -223,6 +225,19 @@ let monTableau = {
}
},
computed: {
filtreColVal_visible: function () {
let head = this.searchInputHead;
let val = this.searchInputVal;
if (!head) {
return this.filtreColVal;
} else {
let filtreColVal_visible = {};
filtreColVal_visible[head] = this.filtreColVal[head].filter((v) => {
return v.indexOf(val) !== -1;
});
return filtreColVal_visible;
}
},
tableau: function () {
this.setPages();
if (!this.search && !this.filtreColModif) {
@ -331,8 +346,14 @@ let monTableau = {
},
},
methods: {
hanldeSearchInput(event, head) {
this.searchInputHead = head;
this.searchInputVal = event.target.value;
},
selectValCol() {
this.filtreColModif++;
this.searchInputVal = '';
this.searchInputHead = '';
},
calculer_nameLocalStorage() {
if (this.apiuri) {
@ -593,11 +614,14 @@ let monTableau = {
v-if="filtreColType[head] === 'select'"
v-model="filtreColSelected[head]"
:options="filtreColVal[head]"
:visible-options="filtreColVal_visible[head]"
hide-selected
multiple
taggable
close-on-select
searchable
@selected="selectValCol"
@search:input="hanldeSearchInput($event, head)"
></vue-select>
<input

File diff suppressed because one or more lines are too long