Vue.js 如何删除过滤器函数的重音符号?
我目前将逻辑从复制到一个个人项目,但我有一个问题,因此api返回带有拉丁口音的文本。你知道如何移除它吗 我希望无论搜索时是否带重音,都能显示结果Vue.js 如何删除过滤器函数的重音符号?,vue.js,Vue.js,我目前将逻辑从复制到一个个人项目,但我有一个问题,因此api返回带有拉丁口音的文本。你知道如何移除它吗 我希望无论搜索时是否带重音,都能显示结果 见 new Vue({ el: "#app", data: { textSearch: "", countries: [] }, computed: { countriesFilter: function() { var textSearch = this.textSearch;
见
new Vue({
el: "#app",
data: {
textSearch: "",
countries: []
},
computed: {
countriesFilter: function() {
var textSearch = this.textSearch;
return this.countries.filter(function(el) {
return el.name.toLowerCase().indexOf(textSearch.toLowerCase()) !== -1;
});
}
},
created: function() {
var that = this;
axios.get('https://restcountries.eu/rest/v2/all')
.then(function (response) {
that.countries = response.data;
})
.catch(function (error) {
console.log(error);
});
},
mounted: function() {
$.scrollUp();
}
})