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

add scopeId to components in component #756

Merged
merged 4 commits into from
Feb 21, 2020
Merged

add scopeId to components in component #756

merged 4 commits into from
Feb 21, 2020

Conversation

hareku
Copy link
Contributor

@hareku hareku commented Feb 21, 2020

No description provided.

@yyx990803
Copy link
Member

yyx990803 commented Feb 21, 2020

I think it's questionable whether we want to keep this behavior, as it has led to confusing behavior in the past, e.g. a parent scope rule accidentally affecting the child because the child root happens to have the same class name:

In parent:

<template>
  <Child />
</template>

<style scoped>
.foo { color: red }
</style>

In child:

<template>
  <div class="foo">hello</div>
</template>

IMO if the parent wants to explicitly style the child root it should use a deep selector.

Of course, removing this behavior would be a breaking change, and we should probably add it to this RFC.

@yyx990803
Copy link
Member

I'll merge this since this keeps the behavior consistent with 2.x. We will revisit the change as part of the RFC discussion.

@yyx990803 yyx990803 merged commit 9547c2b into vuejs:master Feb 21, 2020
@hareku hareku deleted the fix-scopeid branch February 21, 2020 13:49
@hareku
Copy link
Contributor Author

hareku commented Feb 21, 2020

@yyx990803
Thank you refactor and merge it.

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.

None yet

2 participants