Skip to content

fix(runtime-core): global mixin lifecyclehooks execute after component lifecyclehooks when use both Composition API and Options API #5927

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

liulinboyi
Copy link
Member

close #5918
fix(runtime-core): global mixin lifecyclehooks execute after component lifecyclehooks when use both Composition API and Options API

@netlify
Copy link

netlify bot commented May 16, 2022

Deploy Preview for vuejs-coverage failed.

Name Link
🔨 Latest commit 89be5ca5f3a18586f619992c9b00158081da6870
🔍 Latest deploy log https://app.netlify.com/sites/vuejs-coverage/deploys/6281fb4ad1cc3d0009507a4b

@liulinboyi liulinboyi force-pushed the fix-5918 branch 2 times, most recently from 89be5ca to 4c7cf0e Compare May 16, 2022 07:26
@liulinboyi
Copy link
Member Author

Already tick the "allow edits from maintainer".

…t lifecyclehooks when use both Composition API and Options API
@edison1105
Copy link
Member

The reproduction in #5918 seems incorrect, but from the description, it appears that the Options API and Composition API are mixed, which is not recommended. The lifecycle hooks of the Options API are designed to run after the lifecycle hooks of the Composition API. Therefore, I think it does not need to be fixed.

@skirtles-code
Copy link
Contributor

I don't think there's a bug here. The exact execution order of mounted/onMounted isn't documented and I don't see a compelling reason why a global mixin should be given priority. While I can understand the reasoning that the global mixin is registered first, it could equally be argued that mounted consistently runs after onMounted, irrespective of where the mounted comes from.

Considering the extra code involved it doesn't seem worth changing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Review
Development

Successfully merging this pull request may close these issues.

vue3 全局 mixin mounted 在 组件 Composition setup onMounted 钩子后执行
3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy