[英]Vue.js filrter not works with special character
I have a filter witch looks inside a items: {}
array, this array have 26 objects inside. 我有一个过滤器,它在一个
items: {}
内查找items: {}
数组,该数组内部有26个对象。 The object 24 have an alias with special character ñ
. 对象24具有特殊字符
ñ
的别名。 The filter not works on this object and the next ones until the end of the items array. 直到items数组的末尾,过滤器才对这个对象和下一个对象起作用。
items: {
[...]
23: {
alias: "Correcto",
id: 11
},
24: {
alias: "Tamaño",
id: 12
}
25: {
alias: "silla",
id: 13
}
};
This is the code of my filter as a computed:
porperty 这是我的过滤器的
computed:
代码computed:
porperty
computed: {
filteredItems() {
if (this.items) {
return this.items.filter((item) => {
if (!this.search) return '';
return item.alias.toLowerCase().match(this.search.toLowerCase().trim());
});
}
}
},
How can i make the filter works with any type of characters? 如何使过滤器适用于任何类型的字符?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.