Optimisation, si pas de caractere, on ne passe pas dans le filtre
This commit is contained in:
parent
ef82382f33
commit
99a6444c39
2 changed files with 11 additions and 12 deletions
|
@ -109,14 +109,13 @@ let monTableau = {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
tableau: function () {
|
tableau: function () {
|
||||||
return this.pagination(
|
if (!this.search) {
|
||||||
this.table.filter((ligne) => {
|
return this.pagination(this.table);
|
||||||
if (this.search) {
|
|
||||||
return Object.values(ligne).toString().toLowerCase().indexOf(this.search) < 0 ? false : true;
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
})
|
return this.pagination(
|
||||||
|
this.table.filter((ligne) =>
|
||||||
|
Object.values(ligne).toString().toLowerCase().indexOf(this.search.toLowerCase()) < 0 ? false : true
|
||||||
|
)
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -130,12 +130,12 @@ var monTableau = {
|
||||||
tableau: function tableau() {
|
tableau: function tableau() {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
return this.pagination(this.table.filter(function (ligne) {
|
if (!this.search) {
|
||||||
if (_this.search) {
|
return this.pagination(this.table);
|
||||||
return Object.values(ligne).toString().toLowerCase().indexOf(_this.search) < 0 ? false : true;
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return this.pagination(this.table.filter(function (ligne) {
|
||||||
|
return Object.values(ligne).toString().toLowerCase().indexOf(_this.search.toLowerCase()) < 0 ? false : true;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue