C
C
Cyril2017-06-22 10:45:30
Vue.js
Cyril, 2017-06-22 10:45:30

How to change styles of dynamically created elements in vuejs?

<ul>
   <li v-for="post in posts">
      <button>
          Удалить
      </button>
   </li>
</ul>

.invisible {
   display: none
}

actually the essence of the question: when you click on the "Delete" button, you need to assign the invisible class to the li element, in which the pressed button is wrapped. Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2017-06-22
@njee

When you click on delete, you do not need to assign a class, you need to remove it from the collection. Or, if there is a subtask to display also remote ones, then change the property, and display the filtered elements. This is not jquery for you.
Well, there is a good example in the documentation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question