Home > Software engineering >  Vue bind multiple class with conditional
Vue bind multiple class with conditional

Time:03-19

I have the following div in my component:

<div : >

I want to add another class to this, which is a computed property:

computed: {
    borderColor() {
        return {
            "bg-white": this.$apollo.loading,
            [colorBorder[this.board?.color]]: true
        }
    },
}

Can anyone advise how I can do this please?

CodePudding user response:

Try to use the array syntax :

<div :
  • Related