How to select a tab with Ionic5?

which is the correct way to select programmatically a tab with Ionic5?

With previous versions of Ionic I used the code:;

The tabs are defined in this way:


  <ion-tab-bar slot="bottom">
    <ion-tab-button tab="dashboard">
      <ion-icon name="triangle"></ion-icon>
      <ion-label>Tab 1</ion-label>

    <ion-tab-button tab="tab2">
      <ion-icon name="ellipse"></ion-icon>
      <ion-label>Tab 2</ion-label>

    <ion-tab-button tab="tab3">
      <ion-icon name="square"></ion-icon>
      <ion-label>Tab 3</ion-label>


Thank you

Claudio B.

Excuse me, I’ve solved in this way:

Ref: Ionic v4: Change active tab dynamically