mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 11:17:19 +08:00
fix(button): dynamic bar-button
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user