mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
fix(all): strong typed events
This commit is contained in:
@ -2,10 +2,10 @@
|
||||
```html
|
||||
<!-- Segment buttons with text and click listeners -->
|
||||
<ion-segment>
|
||||
<ion-segment-button (ionClick)="segmentButtonClicked($event)">
|
||||
<ion-segment-button (ionSelect)="segmentButtonClicked($event)">
|
||||
Friends
|
||||
</ion-segment-button>
|
||||
<ion-segment-button (ionClick)="segmentButtonClicked($event)">
|
||||
<ion-segment-button (ionSelect)="segmentButtonClicked($event)">
|
||||
Enemies
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
|
@ -51,7 +51,7 @@
|
||||
// Listen for ionClick on all segment buttons
|
||||
const segmentButtons = document.querySelectorAll('ion-segment-button')
|
||||
for (let i = 0; i < segmentButtons.length; i++) {
|
||||
segmentButtons[i].addEventListener('ionClick', (ev) => {
|
||||
segmentButtons[i].addEventListener('ionSelect', (ev) => {
|
||||
console.log('Segment button clicked', ev);
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user