Open p0g opened 3 years ago
Were you able to find a solution for this?
Were you able to find a solution for this?
No sorry, and i dont use this component anymore (to outdated)
I think this would be a good addition. The v-model is only for the query, not the selected item. There was some initial hackery with setChangeItem, but providing a prop or other that can set the initial item would be good. initialSelected
or something, open to ideas.
re: "too outdated" comment, I am curious if there is anything you feel is outdated with respect to Vue 2.x? I am currently porting it over to support Vue 3.x here: https://github.com/darrenjennings/vue-autosuggest/tree/next/v3
I think this would be a good addition. The v-model is only for the query, not the selected item. There was some initial hackery with setChangeItem, but providing a prop or other that can set the initial item would be good.
initialSelected
or something, open to ideas.re: "too outdated" comment, I am curious if there is anything you feel is outdated with respect to Vue 2.x? I am currently porting it over to support Vue 3.x here: https://github.com/darrenjennings/vue-autosuggest/tree/next/v3
Hello @darrenjennings! I'm using your component and am trying to set a default value from my :suggestions list. I would like to know if you can show how to, as you said, hack it, and set the default value.
I think this would be a good addition. The v-model is only for the query, not the selected item. There was some initial hackery with setChangeItem, but providing a prop or other that can set the initial item would be good.
initialSelected
or something, open to ideas. re: "too outdated" comment, I am curious if there is anything you feel is outdated with respect to Vue 2.x? I am currently porting it over to support Vue 3.x here: https://github.com/darrenjennings/vue-autosuggest/tree/next/v3Hello @darrenjennings! I'm using your component and am trying to set a default value from my :suggestions list. I would like to know if you can show how to, as you said, hack it, and set the default value.
I found the solution. The component accepts v-model, you can set the default value that way.
vue-autosuggest
version: 2.2.0hi.
How to preselect an object value?
Using the v-model, is only setting the "userinput", but not the selected-value (and it only accept Strings)
See the forked sandbox where i try to set Gandalf at the inital, selected object, without any user-interaction. https://codesandbox.io/s/vueautosuggest-20-base-forked-cgy1s?file=/App.vue:2857-3206
This function is relevant for an project where i store the selected object in localstorage, to restore later without bother the user every time.