Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue diff component component execution mounted order problem #10675

Open
FreeLiC opened this issue Apr 10, 2024 · 3 comments
Open

Vue diff component component execution mounted order problem #10675

FreeLiC opened this issue Apr 10, 2024 · 3 comments

Comments

@FreeLiC
Copy link
Author

FreeLiC commented Apr 10, 2024

v-for must need add key

@Doctor-wu
Copy link
Contributor

In fact, they will be mounted in the same tick, I am curious what's the problem in the real-world use.

@FreeLiC
Copy link
Author

FreeLiC commented Apr 11, 2024

In fact, they will be mounted in the same tick, I am curious what's the problem in the real-world use.

For example: In some business logic, I need to record the sequence of v-for loop update triggers in the component mounted life cycle into an array, and use subscripts to get the sequence to meet some business logic requirements, but I found that The life cycle of the Vue diff trigger component is from back to front, which causes the order of my records to be reversed.
There is another situation where such a problem may exist. The components at the same level are executed asynchronously and sequentially (although these business logics can be avoided by technical means), which will also cause problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants