mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 04:53:58 +08:00
refactor(segment): remove uneccessary function
This commit is contained in:
@ -17,7 +17,7 @@ export class SegmentView implements ComponentInterface {
|
||||
if (!atSnappingPoint) return;
|
||||
|
||||
const index = Math.round(scrollLeft / offsetWidth);
|
||||
const segmentContent = this.getSegmentContentAtIndex(index);
|
||||
const segmentContent = this.getSegmentContents()[index];
|
||||
|
||||
if (segmentContent === null || segmentContent === undefined) {
|
||||
return;
|
||||
@ -50,10 +50,6 @@ export class SegmentView implements ComponentInterface {
|
||||
return Array.from(this.el.querySelectorAll('ion-segment-content'));
|
||||
}
|
||||
|
||||
private getSegmentContentAtIndex(index: number) {
|
||||
return this.getSegmentContents()[index];
|
||||
}
|
||||
|
||||
private getSegmentButtonById(id: string) {
|
||||
return document.querySelector(`ion-segment-button[content-id="${id}"]`);
|
||||
}
|
||||
|
Reference in New Issue
Block a user