uniapp 开发的支付宝小程序修改子组件样式无效的解决方法

 想要的样式:

 实际样式:

 出现原因:我把下面的代码写在了@import 'home.scss';中

  /deep/ .title-bar{
    height: auto!important;
    .nav-action{
      background: none;
      .btn-search{
        margin: 0;
      }
    }
  }

 应该直接放在当前页的下面就起作用了

<style lang="scss" scoped>
  @import 'home.scss';
  // 写在home.scss中无效
  /deep/ .title-bar{
    height: auto!important;
    .nav-action{
      background: none;
      .btn-search{
        margin: 0;
      }
    }
  }
</style>

猜你喜欢

转载自blog.csdn.net/LzzMandy/article/details/122037958