D
D
Denis Bukreev2016-08-17 16:40:14
JavaScript
Denis Bukreev, 2016-08-17 16:40:14

How to work in VueJS with select multiple?

Single selects are described in the documentation, but there is not a word about multiple selects.
I have for example select:

<select multiple="">
  <option value="">Field Type</option>
  <option v-for="value in field.value" value="{{ value.name }}">{{ value.name }}</option>
</select>

and data:
{
  name: 'Engine type',
  value: [
    {
      name: 'Petrol'
    },
    {
      name: 'Diesel'
    },
    {
      name: 'Pedal'
    },
    {
      name: 'Manual'
    }
  ]
}

What to add to data to mark selected selects and how to manage it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
D', 2016-08-17
@denisbookreev

So (corrected by Sergey Melnikov ):
jsbin.com/fejeteyeco/1/edit?html,output

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question