diff --git a/docs/.vuepress/components/Paginated.vue b/docs/.vuepress/components/Paginated.vue index 9918d4c..30b04cc 100644 --- a/docs/.vuepress/components/Paginated.vue +++ b/docs/.vuepress/components/Paginated.vue @@ -1,12 +1,8 @@ @@ -22,24 +18,32 @@ export default { }), computed: { filtered() { - return this.countries.filter((country) => country.includes(this.search)) + return this.countries.filter((country) => + country.toLocaleLowerCase().includes(this.search.toLocaleLowerCase()) + ) }, paginated() { return this.filtered.slice(this.offset, this.limit + this.offset) }, hasNextPage() { - const nextOffset = this.offset + 10 + const nextOffset = this.offset + this.limit return Boolean( this.filtered.slice(nextOffset, this.limit + nextOffset).length ) }, hasPrevPage() { - const prevOffset = this.offset - 10 + const prevOffset = this.offset - this.limit return Boolean( this.filtered.slice(prevOffset, this.limit + prevOffset).length ) }, }, + methods: { + onSearch(query) { + this.search = query + this.offset = 0 + }, + }, }