vue-instant icon indicating copy to clipboard operation
vue-instant copied to clipboard

How to configure vue-instant to display suggestions that do not match the query?

Open paul0id opened this issue 6 years ago • 2 comments

I use the your wonderful component and everything in it is good, only when an array of "suggestions" comes from the back-end, vue-instant shows only those that strictly match the query.

That is, if I enter "Mosk" - I see "Moscow", and if I introduce "Moks" - then I will not see anything, although the answer from the server will come from "Moscow" and I passed it through the "suggestions" parameter.

How to make him withdraw everything that I give him?

paul0id avatar May 17 '19 12:05 paul0id

Just create other block for the notify about it and show block when you get empty query result.

Like this:

<div id="app">
  <label>Some label</label>
  <vue-instant :suggestions="suggestions" [...other props...]></vue-instant>
  <div v-if="!suggestions.length" class="empty-suggestions">Empty result</div>
</div>

Staferot avatar May 23 '19 08:05 Staferot

Thanks for the answer. But that is not the question. I need the component to output all the results I received from the backend.

paul0id avatar May 30 '19 06:05 paul0id