0👍
you can access a collection of roles in vue.js as user.roles
array.
but if you want all the roles’ name you will need to iterate through the array or use map
function.
user.roles.map(role => role.name)
Assuming that each role has property name
.
Source:stackexchange.com