Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Why can't DOM be reused in this case? #13013

Unanswered
dddssw asked this question in Help/Questions
Discussion options

Hi, I have a question about reusing dom

For example, I have a Array, I divide it into 4 columns and add the sub-items in the array to these columns one by one,

<div v-for="(col, colIndex) in columns" :key="colIndex">
 <div v-for="item in col" :key="item.id">
 <ItemComponent :item="item" />
 </div>
</div>

After that,I divide it into 3 columns and add the sub-items in the array to these columns one by one

Because the sub-items in the array are the same, the DOM should be reusable

But now the DOM will not be reused

As far as I understand it, the diff algorithm will only compare the same layer

Is there no other way to reuse it?

You must be logged in to vote

Replies: 1 comment

Comment options

Reuse partly
playground

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /