Skip to content

Instantly share code, notes, and snippets.

@flowck
Last active June 24, 2018 10:09
Show Gist options
  • Save flowck/ddb812a40d264e4f4a450602098c942d to your computer and use it in GitHub Desktop.
Save flowck/ddb812a40d264e4f4a450602098c942d to your computer and use it in GitHub Desktop.
computed: {
countriesResults() {
// Filter results
return this.countries.filter((country) => {
return country.name.toLowerCase()
.indexOf(this.search.toLowerCase()) > -1;
});
}
}
<ul>
<li v-for="country in countriesResults" :key="country.id">
{{ country.name }}
</li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment