vue-search-select
vue-search-select copied to clipboard
Object as a default value
options2: [
{ value: '1', text: 'aa' + ' - ' + '1' },
{ value: '2', text: 'ab' + ' - ' + '2' },
{ value: '3', text: 'bc' + ' - ' + '3' },
{ value: '4', text: 'cd' + ' - ' + '4' },
{ value: '5', text: 'de' + ' - ' + '5' }
],
item2: ''
According to the example this should work, however, if I have:
options2: [
{ value: {a : 1, ...}, text: 'aa' + ' - ' + '1' },
{ value: {a : 1, ...}, text: 'ab' + ' - ' + '2' },
{ value: {a : 1, ...}, text: 'bc' + ' - ' + '3' },
{ value: {a : 1, ...}, text: 'cd' + ' - ' + '4' },
{ value: {a : 1, ...}, text: 'de' + ' - ' + '5' }
],
item2: {}
if I select 'aa' + ' - ' + '1' I would expect to get {a : 1, ...} as my v-model, but I am getting this { value: {a : 1, ...}, text: 'aa' + ' - ' + '1' }, which is really confusing
Did you solve it?
any updates on this?
Originally object value was designed for ModelList How about use ModelList with optionValue, optionText and customText props?
Any updates on this? I am trying to force the model-list to take the default from v-model, and i do specify that the value is in the search list also.
This is not working. anyone found a solution?