Vue.js v-for loops two items at a time, and the processing functions in it will be called repeatedly.

what I"m going to implement now is that v-for loops by pressing 2 items at a time, in which there are functions that deal with index, but there will be repeated calls to index in accordance with the situation.
template:
clipboard.png
scrip:


:

clipboard.png
does anyone have the same problem? The result I want is that the printed index is either repeated or executed once.

Apr.05,2021

extract this paragraph separately to verify and exclude


caused by other logical problems. The reason is that it should be caused by the render of vue. It should be because I changed the totalPage in mouted to re-render p, and there are useful functions in p, so it was executed again to change the setting of totalPage to created.

Menu