vue中私有样式(scoped)中修改其他组件的样式

1、使用">>>"符号更改其他组件的样式

  例如

    <style lang="stylus" scoped>
      .a >>> .b 
        /*样式*/
     </style>
2、当lang = less or sass 时 解析不了">>>"符号,则使用 /deep/

     例如

    <style lang="less" scoped>
      .a /deep/ .b {
        /*样式*/
       }
     </style>
3、.vue界面中使用两个style标签 ,一个加scoped,一个不加
  

 例如

    <style lang="less">  

    </style>
    <style lang="less" scoped>
      
     </style>

猜你喜欢

转载自www.cnblogs.com/ruishuiweixiang/p/9285240.html