AntDesign样式穿透解决方案

业务效果


// 直接放在style标签中 不要放在<style lang="scss" scoped>标签中
<style>
.ant-table.ant-table-bordered .ant-table-title {
background: #f3f3f3;
}
</style>

上述方式会导致整个项目中该组件样式发生改变,要想只在当前组件生效

.right-content {
margin-top: 20px;
height: 100vh;
// 案例
// Vue2中穿透方式
& >>> .ant-steps-vertical .ant-steps-item .ant-steps-item-title{
color: red;
}
// Vue3中穿透方式
& :deep(.ant-tabs-tab) {
color: yellow;
border: 1px solid red;
border-radius: 15px;
}
& :deep(.ant-tabs-tab-active) {
color: red;
}
}

参考: http://www.ppmy.cn/news/5467.html

posted @   Felix_Openmind  阅读(1235)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 终于写完轮子一部分:tcp代理 了,记录一下
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
*{cursor: url(https://files-cdn.cnblogs.com/files/morango/fish-cursor.ico),auto;}
点击右上角即可分享
微信分享提示