J
J
jazzus2019-03-02 20:23:57
Vue.js
jazzus, 2019-03-02 20:23:57

How to embed a variable in a class that changes by condition?

The code

<a href="#" :class="{'list-group-item-'+list.tag: list.approved}">{{list.name}}</a>

In Approved true/false
Swears
invalid expression: Unexpected token + in
How it is correct to register all this?
Tasks:
Changing a class by condition
Embedding a variable in a class

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ihor Bratukh, 2019-03-02
@jazzus

Take object key in []

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question