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-深度选择器 /deep/ #47

Open
PleaseStartYourPerformance opened this issue Jun 21, 2021 · 0 comments
Open

Vue-深度选择器 /deep/ #47

PleaseStartYourPerformance opened this issue Jun 21, 2021 · 0 comments

Comments

@PleaseStartYourPerformance
Copy link
Owner

vue组件编译后,会将 template 中的每个元素加入 [data-v-xxxx] 属性来确保 style scoped 仅本组件的元素而不会污染全局,但如果你引用了第三方组件:

image
(这是 组件的源码: https://github.com/airyland/vux/blob/v2/src/components/group/index.vue

所以,如果你期待通过如下方式修改 weui-cells 的样式。是没有任何效果的:

<style scoped>
    .fuck .weui-cells {
        // ...
    }
</style>

这是因为,所有的scoped中的css最终编译出来都会变成这样:

.fuck[data-v-17bb9a05] .weui-cells[data-v-17bb9a05]

image

image

image

原文链接:https://www.cnblogs.com/CyLee/p/10006065.html

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

1 participant