Skip to content

Commit

Permalink
fix(module: inputitem): fix inputitem label css init (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuonuoge authored and sWhite01111 committed Apr 1, 2019
1 parent 3f2a83c commit bd11c54
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions components/input-item/input-item.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
Component,
OnInit,
AfterViewInit,
Input,
Output,
EventEmitter,
Expand All @@ -25,7 +25,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
}
]
})
export class InputItem implements OnInit, OnChanges, ControlValueAccessor {
export class InputItem implements AfterViewInit, OnChanges, ControlValueAccessor {
prefixCls: string = 'am-input';
wrapCls: object;
labelCls: object;
Expand Down Expand Up @@ -379,9 +379,11 @@ export class InputItem implements OnInit, OnChanges, ControlValueAccessor {
}
}

ngOnInit() {
this.setCls();
this.render.addClass(this._el, this._prefixListCls + '-item');
this.render.addClass(this._el, this._prefixListCls + '-item-middle');
ngAfterViewInit() {
setTimeout(() => {
this.setCls();
this.render.addClass(this._el, this._prefixListCls + '-item');
this.render.addClass(this._el, this._prefixListCls + '-item-middle');
}, 0);
}
}

0 comments on commit bd11c54

Please sign in to comment.