This might not be the most efficient way of doing it, but you could do something like this:
<label><input class="uk-checkbox" type="checkbox" :checked="hasRole(role.id)" @input="toggleRole(role.id)">{{ role.name }}</label><br />
data {
return {
roleIds: this.user.roles.map(role => role.id)
};
},
methods: {
hasRole (roleId) {
return this.roleIds.includes(roleId);
},
toggleRole (roleId) {
if (this.hasRole(roleId)) {
return this.roleIds = this.roleIds.filter(id => id !== roleId);
}
this.roleIds.push(roleId);
}
}