We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
.a >>> b { xxx } 不生效!!
The text was updated successfully, but these errors were encountered:
vue css scoped 编译步骤
在样式中 添加了 >>> /deep/ ::v-deep 后 编译步骤
Sorry, something went wrong.
在scoped下 使用 样式穿透时 .a::v-deep .b{ xxx },需要保证前面的 类名a在当前组件内,a元素才会被添加 唯一标记,继而通过 .a[data-v-xxx] 来选中下面的元素;
如果 a元素不再组件内,a元素就不是被追加 唯一标识 .a[data-v-xxx] 就没有选中任何元素,样式也就不会生效了
deep 编译后可以选中子组件内部节点的原因:
组件a :<div class="bug">aaa</div> 组件b:<div class="container-b"><componentA /></div>
<div class="bug">aaa</div>
<div class="container-b"><componentA /></div>
不加deep:.container-b .bug => 编译后 => .container-b .bug[data-组件b的样式hash值]
加deep:.container-b .bug => 编译后 => .container-b[data-组件b的样式hash值] .bug
默认加scoped的样式是给最后一个选择器添加scoped独有的hash属性值,加了deep是把最deep后面节点的hash值放在deep前
No branches or pull requests
.a >>> b { xxx } 不生效!!
The text was updated successfully, but these errors were encountered: