S
S
slaxik1232020-04-21 14:17:42
Vue.js
slaxik123, 2020-04-21 14:17:42

Changing the background of a block when the click event fires?

<li v-for="app in apps" :key="app._id" :style="{backgroundColor : color}">
   <div @click="toWork(app)">
      <p>{{app.client}}</p>
       <p>{{app.fromCity}}-<br>{{app.toCity}}</p>
       <p>{{app.date}}</p>
        <p>{{app.logist}}</p>
  </div>
</li>

Нужна помощь, при срабатывании @click нужно менять фон у li, но я почему-то не могу придумать реализацию, прошу помочь.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Tigran Abrahamyan, 2020-04-21
@slaxik123

Did I understand correctly?

D
Daniil Balyanitsya, 2020-04-21
@Salvaga

As an option, throw a block into a component, and then work with it)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question