php-noob-for-now

使用 scoped 后,父组件的样式将不会渗透到子组件中

如果想在使用scoped,不污染全局的情况下,依然可以修改子组件样式,可以使用深度作用选择器

.tree{
    width: 100%;
    float: left;
    margin: 0 10px;
  }
  /deep/.tree .el-tree-node__content{
    padding: 3px 2px;
    margin-right: 40px;
  }

vue官网:https://vue-loader.vuejs.org/guide/scoped-css.html#deep-selectors

分类:

技术点:

相关文章:

  • 2021-06-25
  • 2021-08-29
  • 2022-02-12
  • 2021-12-10
  • 2022-12-23
  • 2021-12-14
  • 2022-01-18
猜你喜欢
  • 2022-01-25
  • 2022-01-22
  • 2022-01-19
  • 2022-02-19
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
相关资源
相似解决方案