Vue-multiselect: How can I set a default search text in vue-multiselect without actually selecting any item?

Created on 15 Oct 2017  路  5Comments  路  Source: shentao/vue-multiselect

We have a multi-select box for searching in our website. I have created a wise dynamic search phrase and I need to set it as the default text in vue-multiselect without actually selecting any item so user can complete the text.
How can I set a default search text for multi-select with no focus?
It is also a good idea if the "noResult slot" is be displayed in this case.

question

Most helpful comment

That is exactly what I need.
I really am grateful for your help.
Sincerely

All 5 comments

That might be hard as the search value is an internal value. A way I imagine it could be possible is to extend the multiselect and add an initialSearch prop. Along this, I would add this to the created lifecycle hook.

created () {
  this.search = this.initialSearch
}

Let me know if this helps. :)

That is exactly what I need.
I really am grateful for your help.
Sincerely

@marjandejyab do you have an example for how you fixed this?

Hello @TomFranssen & @marjandejyab I am facing the same issue but I can't get the solution to work.
Could you share what you've done?

Thank you!
Anthony

this.$refs['your_multiselect_refs_name'].search = default_search_text
i do it like this

Hello @TomFranssen & @marjandejyab I am facing the same issue but I can't get the solution to work.
Could you share what you've done?

Thank you!
Anthony

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dmitov picture dmitov  路  4Comments

focussing picture focussing  路  3Comments

volkanciloglu picture volkanciloglu  路  3Comments

yaakovp picture yaakovp  路  3Comments

wujekbogdan picture wujekbogdan  路  4Comments