ElemeFE / element-angular

Element for Angular
https://element-angular.faas.ele.me
MIT License
530 stars 121 forks source link

如何改变单选框的样式 #85

Closed jasminecjc closed 6 years ago

jasminecjc commented 6 years ago

Issue Type:

Version & Environment:

Description: html:

<el-radio-group [el-class]="'radio-group'" formControlName="type">
      <el-radio *ngFor="let type of types" label="{{type.id}}" [el-class]="'test1'" class="test2">{{type.formName}}</el-radio>
    </el-radio-group>

编译后的html结构为

2018-04-03 4 32 41

css:

.radio-group {
  > div {
    display: flex;
    flex-direction: column;
    padding-left: 5rem;
    border: 1px solid #e6e6e6;
    > lable {
      display: flex;
      width: 100%;
      align-items: center;
      justify-content: center;
    }
  }
}

能够通过el-class radio-group 改变内层的div样式,但改变不了内层lable的样式,给el-radio加上el-class或class也不管用

unix commented 6 years ago

encapsulation: ViewEncapsulation.None 了解一下。

jasminecjc commented 6 years ago

encapsulation: ViewEncapsulation.None 上面说的情况是在这个已经设置的情况下,仍然无法设置label样式