less中,有没有一个参数是可以直接设置所有的以xx开头的class?

现在有那么一个less

  .has-error{
    .ant-form-explain{
      color: @error-color !important
    }
    .ant-select-selection{
      border-color: @error-color !important;
    }
    .ant-input {
      border-color: @error-color !important;
    }
    .ant-input-number {
      border-color: @error-color !important;
    }
    
  }

有没有办法设置 .has-error下 所有ant开头的class?
或者是传入 form-explain select-selection 等参数, 不用每次都复制一遍。

阅读 2.7k
1 个回答
.ant-{
    &form-explain{}
    &select-selection{}
}

& 连接

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