I tried to multiple select with select2 i used laravel and my data on userRoles is returned data on User model with relation roles, and allRoles is just all in Role model code on view
<select class="form-control" name="roles[]" id="roles" multiple>
<option v-for="role in allRoles"
:value="role.id"
>
@{{ role.name }}
</option>
</select>
how to set selected options using userRoles array?