sass嵌套,.child{.parent & { }} 无效?

<span ng-class="{'group-expand': isExpand}">
    <i class="icon-arrow-right"></i>
</span>
@mixin rotate($deg) {
  -webkit-transform: rotate($deg);
  -moz-transform: rotate($deg);
  -ms-transform: rotate($deg);
  -o-transform: rotate($deg);
  transform: rotate($deg);
}

//solution1
.icon-arrow-right {
    @include rotate(0deg);
    .expand & {
        @include rotate(90deg);
    }
}

//solution2
.icon-arrow-right {
    @include rotate(0deg);
}
.expand .icon-arrow-right {
    @include rotate(90deg);
}

请问为何 solution1 无效呢?

阅读 2.9k
1 个回答

复制你的代码 编译成功
是你scss是版本问题吧

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题