wffranco / vue-strap

Bootstrap components built with Vue.js
http://wffranco.github.io/vue-strap/
MIT License
338 stars 133 forks source link

Select multiple populate options from HTTP request #151

Open alexvndre opened 7 years ago

alexvndre commented 7 years ago

Hi,

I would populate my options array with results from an HTTP request but I ran into an error when I added the property "multiple". The HTML select:

<v-select v-model="select.value" :options="select.options" options-value="val"
                      multiple name="animals[]"
                      placeholder="Using placeholder"
                      search justified required
                      clear-button
></v-select>

The JS which is in an HTTP response callbacl:

let i = 0;
this.select.options = [];

while (i < 10) {
    this.select.options.push({
        val: i,
        label: 'toto',
    });
    i += 1;
}

The error is <select multiple v-model="val"> expects an Array value for its binding, but got Null.

Thanks!