Vue-instantsearch: [doc] Bind to existing input

Created on 12 Jul 2017  路  4Comments  路  Source: algolia/vue-instantsearch

Document how to bind query to an existing input.

docs

Most helpful comment

Hey @HemalR ,

To bind to an existing input you would:

  1. use v-model in your input to a variable named query for example: <input type="text" v-model="query">
  2. bind the query to your ais-index like <ais-index :query="query">

Does that help?

All 4 comments

Plus one!

I'm trying to get an element-ui input (http://element.eleme.io/#/en-US/component/input) to be the Algolia input.

I see the documentation regarding styling e.g. results, and that works well, but obviously, there is special binding regarding the input. I'll try to dig into the code and see if I can help out with creating documentation...

Hey @HemalR ,

To bind to an existing input you would:

  1. use v-model in your input to a variable named query for example: <input type="text" v-model="query">
  2. bind the query to your ais-index like <ais-index :query="query">

Does that help?

@rayrutjes Indeed it does! Thanks a tonne!

I spent a couple of hours (warning: noob alert) trying to create my own modified component based on the ais-input component - but for the life of me could not figure out the difference in the structure of how this repo is vs how it was showing up in my node modules! (If that makes sense...)

Also, your solution prompted me to look at the documentation of index and that has it all.

Thanks again!

This should be clear now, since it's documented in both the Vue documentation, as well as the new v2 documentation. See #416 for more info on that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fi0 picture fi0  路  3Comments

samouss picture samouss  路  3Comments

rayrutjes picture rayrutjes  路  3Comments

bobylito picture bobylito  路  4Comments

socieboy picture socieboy  路  5Comments