I guess title is pretty straightforward. This is my select2
in vuejs
<select multiple id="roles" class="form-control" v-model="selected">
<option v-for="role in roles" :value="role.id">{{role.name}}</option>
</select>
The v-model="selected"
is not updating when I am using select2 but works fine when I do not initialize select2
, ie use simple multiselect
.
v-model.lazy may do the trick here. Try following:
<select multiple id="roles" class="form-control" v-model.lazy="selected">
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.