X
X
xxvxx2021-01-28 01:38:17
Vue.js
xxvxx, 2021-01-28 01:38:17

Why is the check class not removed when an element is removed?

It seems that the class is bound to the ID and it is always unique, but it feels like the binding to the array index and I don’t understand what the problem is

...
delete the cross and the class is transferred to 2....
here is an example https://codepen.io/xxvxx/pen/yLajzNW

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2021-01-28
@xxvxx

Because someone inattentively read the documentation .
UPD. Somehow I didn’t think to look at the js code right away. And there, and there ... WHAT THE FUCK IS THIS:

elem.classList.add('check');
elem.querySelector('input[type="checkbox"]').remove();

??
You don't seem to read inattentively - you didn't read at all. Go and read. Right from the start and without a hitch. Unless, of course, your goal is to become a shitcoder.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question