1

I currently copy the logic from this codepen to a personal project, but I have a problem, so the api return text with latin accents. Do you know how to remove it?

I would like the result to be shown regardless of whether I searched with an accent or not.

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();
  }
})
Oscar
  • 11
  • 1

0 Answers0