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

options.placeholderText does not work #9

Open PetrusHahol opened 3 years ago

PetrusHahol commented 3 years ago

Hi Whatever I use as placeholderText is not being used as placeholder for input. In source of a page the placeholder is empty.

    {
      src: "@nuxtjs/lunr-module",
      options: {
        placeholderText: "SearchTest"
      },
    },

Here its substituted. But here used as empty.

I do not use I18N

pimlie commented 3 years ago

@PetrusHahol Could you check the lunr plugin file in your nuxt build dir and see if a default value has been set? Path should be eg src/.nuxt/lunr/plugin.js

Does it work when you add a placeholder attribute on the search component?

PetrusHahol commented 3 years ago

@pimlie In my src/.nuxt/lunr I have only two files. icon-search.svg and search.vue. and if to put some placaholder value in search component, yes it works. You can have a look how it works here.( Push the search button and lunr search will appear. )

PetrusHahol commented 3 years ago

okay, I probably got what you mean by Does it work when you add a placeholder attribute on the search component?. So actually this way

   <lunr-search :style="navSearchLunrStyle"
                       placeholder="Search"
                       class="search"
          >

It also does not work

svd-bug commented 3 years ago

Hi, guys. Are there any updates about this issue? I work on the same project mentioned above. I was successful to see placeholder text only in dev mode. I open the web page to reproduce it, then add placeholder text to the page code and then see the text in the search bar. It stays there up to the page refresh. Then placeholder attribute switches back to empty.

Maybe you will find it useful.

PetrusHahol commented 3 years ago

It works fine with i18n module enabled.