matiastucci/vue-input-tag

Array with properties On Datasource

TioWidow opened this issue · 2 comments

Hello, sorry for the inconvenience but I wonder if it is possible to use a Array with properties as a datasource and specify a property of the array as the item that will be the Label of the tag.

Something like in this example:

<input-tag   v-model="datasource" :tags.sync="text" > </input-tag>

datasource: [ {text:'abc', value:123},{text:'zxc', value:456} ]

Version of Vue I'm using?: 2.0_

Version of vue-input-tag I'm using?: _last

Small JSFiddle showing the issue: _____

@TioWidow If I understood the issue correctly, you could simply use a v-for for that to create a tag for each array element. Then, there would be no need for the feature you proposed.

<input-tag 
  v-for="(obj, index) in array"
  :key="index"
  v-model="obj.value"
  :tags.sync="text">
  {{ obj.text }}
</input-tag>

Hi, currently it's not possible to do that. I'm not planning in adding that feature. But you are welcome to create a PR. Thanks!