0👍
Your code is a little confusing.
What does paymentTypeClass
look like? It looks like you want all the classes on the element based on your logic? If so you can do like:
paymentTypeClasses () {
const classes = this.paymentType.map(type => 'o-pf-list__item--' + type)
classes.push('pull-left')
return classes
}
Then do
:class="paymentTypeClasses()"
or
:class="[paymentTypeClasses()]
(easier to add more classes later)
- [Vuejs]-Returning arrow function from Vuex storage getter: Not understanding
- [Vuejs]-Laravel Passport Authroziation error
Source:stackexchange.com