onIonViewDidLeave on child component

How to Listen to parents onIonViewDidLeave event?
as I check this event only triggered when on parent component, but how can the child component listen to it? is it passible?

<ion-page>
   <child-component />
</ion-page>

I would suggest explaining what you’re actually trying to achieve, because the method you’re asking about would seem to indicate a fundamental design problem.

A properly designed component should be completely independent of how it’s hosted, which means that it needs to be able to do everything without any knowledge of even having a parent.

1 Like

Im planning to create a form wizard which will only supply child elements on the slot tag

<form-wizard>
   <form-item></form-item>
   <form-item></form-item>
</form-wizard>

The form-item should be controlled by form-wizard, meaning I could hide other form-item base on the current index without using/sending property to form-item

form-wizard can access slot items, but cannot send/access data to them,

I dont want to use scope data like:

<form-item v-if="index==0"></form-item>

I want the form-item a ready to go component base on its parent tag form-wizard

Moving this to the Vue subforum, as useful help is likely to be framework-specific. Apologies if that isn’t Vue syntax.

1 Like

Yes please, thank you :slight_smile: