A
A
Andrew2020-12-11 14:41:17
Vue.js
Andrew, 2020-12-11 14:41:17

Intersection Observer not firing for new items in list (vue)?

An example is here.

Everything works fine for elements that were at the time of the created hook, that is, at the time the component was created, but when a new element is added (in the example, the PUSH NEW button), the Observer does not work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2020-12-11
@AndrewRusinas

https://ru.vuejs.org/v2/api/#key
If you add it, everything works.
And yes, the index from v-for cannot be used in this case. Do an ascending sequence with a separate counter and a field in the object, like todo.key.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question