vue 样式穿透问题

vue项目中样式使用scss时,对于需要穿透的样式,使用 >>> 穿透可能会不生效,解决办法也很简单:
将
<style lang="scss" scoped>
.a >>> .b {
  font-size: 24px;
}
</style>

修改为:

<style lang="scss" scoped>
.a /deep/ .b {
  font-size: 24px;
}
</style>
或者

<style lang="scss" scoped>
.a ::v-deep .b {
  font-size: 24px;
}
</style>


官方地址[https://vue-loader.vuejs.org/zh/guide/scoped-css.html#混用本地和全局样式]

相关文章:

  • 2022-12-23
  • 2021-11-30
  • 2021-04-08
  • 2022-12-23
  • 2022-12-23
  • 2021-04-04
猜你喜欢
  • 2022-12-23
  • 2021-08-25
  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
  • 2021-10-10
相关资源
相似解决方案