[Vuejs]-Empty array of entries in nuxt / content module

0👍

This option worked for me

async searchQuery(searchQuery) {
  console.log(this.articles)
  if (!searchQuery) {
    this.articles = []
    return
  }
  this.articles = await this.$content(`/articles/${ this.$root.$i18n.locale }`)
    .limit(6)
    .search(searchQuery)
    .fetch()
}

Leave a comment