mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(item): do not add .item-button to button[ion-item]
This commit is contained in:
@@ -37,7 +37,8 @@ export class Button {
|
||||
constructor(
|
||||
config: Config,
|
||||
private _elementRef: ElementRef,
|
||||
private _renderer: Renderer
|
||||
private _renderer: Renderer,
|
||||
@Attribute('ion-item') ionItem: string
|
||||
) {
|
||||
this._role = 'button'; // bar-button/item-button
|
||||
this._size = null; // large/small
|
||||
@@ -48,6 +49,7 @@ export class Button {
|
||||
this._colors = []; // primary/secondary
|
||||
this._icon = null; // left/right/only
|
||||
this._disabled = false; // disabled
|
||||
this.isItem = (ionItem === '');
|
||||
|
||||
let element = _elementRef.nativeElement;
|
||||
|
||||
|
||||
@@ -65,7 +65,9 @@ export class Item {
|
||||
@ContentChildren(Button)
|
||||
set _buttons(buttons) {
|
||||
buttons.toArray().forEach(button => {
|
||||
button.addClass('item-button');
|
||||
if (!button.isItem) {
|
||||
button.addClass('item-button');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user