/deep/ scss
时间: 2023-09-03 20:07:12 浏览: 272
在Vue中,/deep/是深度作用选择器的简写形式,用于对子组件中的样式进行选择。它在Vue2.x版本中可用,但在Vue3.x版本中会报错。/deep/可以应用于CSS,但不支持CSS预加载器(如less或scss)。
举例来说,如果你想在scoped的scss样式中修改子组件的样式,你可以使用/deep/来实现。比如,你可以这样写/scoped/:
```html
<style scoped lang="scss">
/deep/ .position-el-steps {
/deep/ .el-step.is-vertical {
/deep/ .el-step__description {
margin-top: -20px;
}
}
}
</style>
```
这样就能够选择到子组件中的相应元素,并对其应用样式。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [scss中使用/deep/深度选择器报错的解决办法](https://blog.csdn.net/weixin_44900104/article/details/126164236)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [【脸脸酱】css /deep/ 深度选择器的用法(在scoped文件修改外部组件样式)](https://blog.csdn.net/qq_42557882/article/details/106871329)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [解决vue scoped scss 无效的问题](https://download.csdn.net/download/weixin_38706603/13126415)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文