mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 11:17:19 +08:00
feat(button): add ion-buttons
This commit is contained in:
24
src/components/buttons/buttons.tsx
Normal file
24
src/components/buttons/buttons.tsx
Normal file
@ -0,0 +1,24 @@
|
||||
import { Component, h } from '../index';
|
||||
|
||||
|
||||
@Component({
|
||||
tag: 'ion-buttons',
|
||||
host: {
|
||||
theme: 'bar-buttons'
|
||||
}
|
||||
})
|
||||
export class Buttons {
|
||||
$el: HTMLElement;
|
||||
|
||||
ionViewWillLoad() {
|
||||
// Add bar-button classes to each ion-button
|
||||
const buttons = this.$el.querySelectorAll('ion-button') as any;
|
||||
for (var i = 0; i < buttons.length; i++) {
|
||||
buttons[i].setAttribute('button-type', 'bar-button');
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return <slot></slot>;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user