vuejs-autocomplete
vuejs-autocomplete copied to clipboard
Different formatted string then selected
Hello Charlie, I was wondering, since you added v-html i can add images to the results, awesome, but when I select a result item, the html string is placed into the input field of the autocomplete (the value is correct, is the ID of the dog breed :) )
I tried
@close="closeWindow"
@selected="selectString"
@enter="applyString"
With methods to return a different a different string, for example only the name "affenpinscher" But with no result
How can I affect the input string on selected, NOT the value
Best
Ah good point! We need another property then for the input value or probably better make the switch to a div rather than a text input for the selected value.
I could imagine that just displaying the html string into the div would do it, but having a possibility to use any data would be superb. Thanks charlie (for the time being i'm just swapping the autocomplete with a div on selected, but the user have to tab it twice to get the autocomplete result :)
I could get the user selected data in input field like name but if i go with your data id and name i got the selected data in the input field
Format: :source="[{state:'Andhra Pradesh',name:'Rajahmundry Airport'},{state:'Telangana',name:'Hyderabad Airport'}]"