Is there a way in vue.js to substitute the social
key in the array with another object's key that has a matching value? For instance:
netTeams: {
0: {
social: 'Twitter',
name: 'Red',
id: 32,
group: 'a'
},
1: {
social: 'Twitter',
name: 'Green',
id: 33,
group: 'b'
}
}
and
socials: {
1: Facebook,
2: Instagram,
3: Twitter,
4: Youtube
}
The desired output would be:
netTeams: {
0: {
social: 3,
name: 'Red',
id: 32,
group: 'a'
},
1: {
social: 3,
name: 'Green',
id: 33,
group: 'b'
}
}
I attempted using a computed property, but encountered errors. Any suggestions or tips would be highly appreciated!