我目前将逻辑从this codepen复制到个人项目,但是我遇到了问题,因此api返回带有拉丁字母重音的文本。你知道如何删除它吗?
无论搜索是否带有重音符号,我都希望显示结果。
The codepen link https://codepen.io/vreaxe/pen/zdZWLj
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();
}
})