fix(button): dynamic bar-button

This commit is contained in:
Manu Mtz.-Almeida
2018-03-26 23:09:43 +02:00
parent 1efc0f3a94
commit d0c5f53a08
2 changed files with 7 additions and 8 deletions

View File

@ -33,7 +33,7 @@ export class Button {
* The type of button.
* Possible values are: `"button"`, `"bar-button"`.
*/
@Prop() buttonType = 'button';
@Prop({mutable: true}) buttonType = 'button';
/**
* The button size.
@ -93,6 +93,12 @@ export class Button {
*/
@Event() ionBlur: EventEmitter<BlurEvent>;
componentWillLoad() {
if (this.el.closest('ion-buttons')) {
this.buttonType = 'bar-button';
}
}
onFocus() {
this.ionFocus.emit();
}