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

fix(runtime-core): inherit attrs inconsistent (#2549) #2640

Conversation

luwuer
Copy link
Contributor

@luwuer luwuer commented Nov 19, 2020

Close #2549

Determine if child component is effected by root comments before invoke getChildRoot when in development environment.

@@ -247,6 +253,20 @@ const getChildRoot = (
return [normalizeVNode(childRoot), setRoot]
}

const isRootCommentEffectChild = (vnode: VNode): boolean => {
let children = vnode.children
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const { children } = vnode

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

let children = vnode.children
if (isArray(children)) {
let isFragmentChild = false
let comments = children.filter(child => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const comments

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@luwuer luwuer force-pushed the inherit-attrs-inconsistent-between-dev-and-prod branch from 0caaa0e to e5ba1ce Compare November 25, 2020 01:29
@yyx990803
Copy link
Member

Thanks for the PR, but this is an incomplete fix. The more accurate fix is by detecting such cases at compile time. See 3bc2914

@yyx990803 yyx990803 closed this Nov 27, 2020
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

Successfully merging this pull request may close these issues.

Inconstant inheritAttrs behavior in production and development
3 participants