当前位置:网站首页>Depth (penetration) selector:: v-deep/deep/ and > > >
Depth (penetration) selector:: v-deep/deep/ and > > >
2022-07-03 01:54:00 【13 less】
original text : depth ( through ) Selectors ::v-deep /deep/ And >>>_ I am Lao Wang's blog -CSDN Blog _v-deep
stay vue The development process of the project , Used ElementUI Component style style Used scope attribute , When you want to modify the component style , It is found that it cannot be modified directly , Need to be removed scope Attribute or use depth selector to modify successfully . Get rid of scope It will also affect the global style , In this case , You can use the depth action selector ( That is, style penetration ). This paper makes a record of the depth selector .
1. When used in the project css Native style , Need to use >>> Depth selector to modify , Style of external third-party components
<style lang="css" scoped>
.el-button >>> span{
color: '#f00'
}
</style>
2. When used in the project css The extension language is less, Need to use /deep/ perhaps ::v-deep Depth selector to modify Style of external third-party components .
<style lang="less" scoped>
/deep/.el-button{
span{
color: '#f00'
}
}
.el-button::v-deep{
span{
color: '#f00'
}
}
</style>
3. When used in the project css The extension language is node-sass, Need to use /deep/ perhaps ::v-deep Depth selector to modify Style of external third-party components .
<style lang="scss" scoped>
.el-button::v-deep{
span{
color: '#f00'
}
}
/deep/.el-button{
span{
color: '#f00'
}
}
</style>
4、 When used in the project css The extension language is dart-sass, Need to use ::v-deep Depth selector to modify Style of external third-party components ,dart-sass I won't support it /deep/ and >>> Writing .
<style lang="scss" scoped>
.el-button::v-deep{
span{
color: '#f00'
}
}
</style>
summary :
② vue3.0 Use in /deep/ Will report a mistake , More recommended ::v-deep
③ For the css The preprocessor (scss 、sass、 less) when , depth Selectors ::v-deep More general
边栏推荐
- 浏览器是如何对页面进行渲染的呢?
- 【数据挖掘】任务3:决策树分类
- Smart management of Green Cities: Digital twin underground integrated pipe gallery platform
- 网络安全-病毒
- Anna: Beibei, can you draw?
- Network security ACL access control list
- ¢ growth path and experience sharing of getting an offer
- Everything file search tool
- LabVIEW安装第三方VISA软件后NI VISA失效
- DDL basic operation
猜你喜欢
Redis:Redis的简单使用
Scheme and practice of cold and hot separation of massive data
[data mining] task 3: decision tree classification
STM32 - switch of relay control lamp
[QT] encapsulation of custom controls
【数据挖掘】任务1:距离计算
[technology development-23]: application of DSP in future converged networks
¢ growth path and experience sharing of getting an offer
小程序開發的部分功能
[data mining] task 1: distance calculation
随机推荐
Introduction to kotlin collaboration
Network security - man in the middle attack
Wordinsert formula /endnote
Function definition and call, this, strict mode, higher-order function, closure, recursion
可视化yolov5格式数据集(labelme json文件)
Network security - scan
How is the mask effect achieved in the LPL ban/pick selection stage?
2022 spring "golden three silver four" job hopping prerequisites: Software Test interview questions (with answers)
[technology development-23]: application of DSP in future converged networks
[error record] navigator operation requested with a context that does not include a naviga
Network security - the simplest virus
[QT] encapsulation of custom controls
Niuniu's ball guessing game (dynamic planning + prefix influence)
Certaines fonctionnalités du développement d'applets
Network security - password cracking
小程序开发黑马购物商城中遇到的问题
【數據挖掘】任務6:DBSCAN聚類
JUC thread scheduling
[data mining] task 5: k-means/dbscan clustering: double square
【数据挖掘】任务1:距离计算