-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AutoComplete v-model on specific field #355
Comments
My idea is using computed field sync simple var with selected object, or watching the selected object |
Yes, that would work. If there are more requests, we may consider adding props like optionLabel, optionValue like the select components to AutoComplete. |
I would also like to see this option. Strange that you haven't implemented it. Example: I've list of objects but need only ID field as v-model. |
I would also like to see this option. |
i aldo need this, was there no update lately? |
+1 would love to see this too. I switched from Vuetify where this was working, you could specify the prop for label and for value, then you could also switch if you want to return just the value prop (for example id) or the whole object, which was really useful. Now I need to create my custom wrapper for the Autocomplete to do this. If anyone finds it useful, here is my wrapper for the AutoComplete: Github gist It accepts an array of objects with props 'label' and 'value' in the 'items' prop and returns just the value of selected object in the wrapper's v-model, it also converts the 'value' prop of the v-model passed to the wrapper back into object and feeds it to AutoComplete. |
Would be really nice to have that option. I'm basically transforming my Vue model to query parameters immediately, and having an object instead of the value inside it will create |
ya ya, autocomplete + v-mode databinding need that so badly. Please support |
I agree! I need optionValue props. |
I agree! I need optionValue props as well |
Cmon, please? :) @cagataycivici |
Base on my understanding autocomplete not design as prefetch all value. In that case autocomplete very hard to obtain label and value separately. If you need that you shall use dropdown, or create separate component, perform deeper engineering, play with emits to modify achieve the goal. I'm using primevue auto complete but I have similar requirement with you, with more complex requirement so I created own customize component on top of autocomplete |
Hello,
I want to use the autoComplete component with complex object like suggestions.
But I need to bind the model on a specific field of the suggestion only.
We can specify the field to display selection but i need to bind on other field.
For example, a user with id and name, we want to display the name and autocomplete on it but the binding is on the id of the user.
Sincerely
The text was updated successfully, but these errors were encountered: