vue-search-select icon indicating copy to clipboard operation
vue-search-select copied to clipboard

Object as a default value

Open SolusProject opened this issue 7 years ago • 4 comments

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

SolusProject avatar Jan 19 '18 20:01 SolusProject

Did you solve it?

spk27 avatar May 20 '18 22:05 spk27

any updates on this?

skourismanolis avatar Dec 12 '18 18:12 skourismanolis

Originally object value was designed for ModelList How about use ModelList with optionValue, optionText and customText props?

moreta avatar Jan 21 '19 15:01 moreta

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?

stedda avatar Apr 03 '19 16:04 stedda