小编Sno*_*ses的帖子

Ionic 4 ionViewDidEnter() didnt triggered after navigated from ion-back-button

I'm having stuck with Ionic apps. My problem is I want to refresh the root page after navigated from the other page by clicking the ion-back-button, I'm trying to use the ionic lifecycle events.

Anyone having issues with the ionViewDidEnter() too (like in my case)? As I know these lifecycle event function, it’s fired when entering a page, before it becomes the active one.

This is DOM elements when the QR page become active:

在此处输入图片说明

As you can see there …

ionic-framework angular ionic4

6
推荐指数
2
解决办法
4293
查看次数

Ionic 4 更改带有自定义图标的 ion-tab-button

单击ion-icon后,我尝试使用自定义 src进行更改ion-tab-button

我尝试过的,使用 (click) 事件触发功能并更改离子图标内的 [src]="..."

有什么合适的方法可以改变这种黑客风格吗?

HTML:

 <ion-tabs>
  <ion-tab-bar slot="bottom">
    <ion-tab-button tab="news/home" (click)="changeNewsIcon()">
      <ion-icon [src]="newsIcon"></ion-icon>
      <ion-label class="tab-title">News</ion-label>
    </ion-tab-button>
    <ion-tab-button tab="user" (click)="changeSearchIcon()">
      <ion-icon [src]="searchIcon"></ion-icon>
      <ion-label class="tab-title">Search</ion-label>
    </ion-tab-button>
    <ion-tab-button tab="networking" (click)="changeNetworkIcon()">
      <ion-icon [src]="notiIcon"></ion-icon>
      <ion-label class="tab-title">Networking</ion-label>
    </ion-tab-button>
    <ion-tab-button tab="chat" (click)="changeChatIcon()">
      <ion-icon [src]="chatIcon"></ion-icon>
      <ion-label class="tab-title">Chat</ion-label>
    </ion-tab-button>
    <ion-tab-button tab="profile" (click)="changeProfIcon()">
      <ion-icon [src]="profIcon"></ion-icon>
      <ion-label class="tab-title">Profile</ion-label>
    </ion-tab-button>
  </ion-tab-bar>
</ion-tabs>
Run Code Online (Sandbox Code Playgroud)

TS :

newsIcon = './assets/tabs/home.svg';
searchIcon = './assets/tabs/search.svg';
notiIcon = './assets/tabs/group.svg';
chatIcon = './assets/tabs/chat.svg';
profIcon = './assets/tabs/user.svg';

changeNewsIcon(): void {    
  // change news icon …
Run Code Online (Sandbox Code Playgroud)

javascript ionic-framework angular ionic4

4
推荐指数
2
解决办法
6784
查看次数

标签 统计

angular ×2

ionic-framework ×2

ionic4 ×2

javascript ×1