0

I have the following div in my component:

<div :class="sidebarOpen ? 'translate-x-0 ease-out transition-medium' : '-translate-x-full ease-in transition-medium'" class="sidebar fixed z-30 inset-y-0 left-0 w-64 px-8 py-4 border-r overflow-auto lg:static lg:inset-auto lg:translate-x-0">

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?

0

1 Answer 1

1

Try to use the array syntax :

<div :class="[sidebarOpen ?'...':'...',borderColor]"
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.