When working inside a v-for
loop, I am attempting to add a character at the beginning of each item in a nested array that may contain multiple items.
I have explored various options but have not been successful:
:data-filter="addDot(item.buttonFilters)"
addCharacter(el) {
for(let i = 0; i < el.length; i++){
return '.'+el+','
}
},
=> data-filter=".cat2,cat1,"
Another approach:
:data-filter="'.'+item.buttonFilters"
=> data-filter=".cat1,cat2"
Desired final result:
=> data-filter=".cat1,.cat2"
Thank you!