cyberfly
1/24/2019 - 3:23 AM

VueJS custom select component usage example

<v-select
                            v-model="user.roles"
                            :items="roles"
                            :value_key="'id'"
                            :label_key="'name'"
                            :field_name="'roles'"
                            :label="'Role'"
                            :multiple="true"
                            :rules="'required'"
                    ></v-select>



                    <label for="roles">Role</label>
                    <select name="roles" v-model="user.rolesa" v-validate="'required'" class="form-control" id="roles" multiple>
                        <option v-for="role in roles" :value="role.id" >{{ role.name }}</option>
                    </select>
                    <div class="invalid-feedback">{{ errors.first('roles') }}</div>