nuxt-community / lunr-module

Full-text search with pre-build indexes for Nuxt.js using lunr.js
MIT License
47 stars 8 forks source link

how to access `searchText ` from lib/search.vue to the <lunr-search> component #13

Open anjali89r opened 3 years ago

anjali89r commented 3 years ago

I'm looking for a way to add the searchText entered by the user to the URL as a search query like ..url/search?q=mysearchterm. But I'm unable to access the searchText from the lib/search.vue folder. How to access this value?

sandoche commented 3 years ago

I use this as a workaround

      const search = document.getElementById('lunr-search')
      const searchTest = search.value