What event to trigger when a custom component is loaded

I am struggling with figuring out what event I can trigger when a component is loaded so certain actions execute. Something similar like “on page load” but for a component. I tried “on mounted” but nothing really happens. I am trying to add inputs inside components and getting initial values, updated values etc outside of the component seems impossible.

as an example I would like to be able to :

  • set the variable I created to hold the value of an input to the initial value. Right now the value is empty as it is only set on change
  • I want to be able to “clear” a date range input - right now it just resets values to the initial value specified on component level

Thanks!

On mounted should work, maybe you’re doing it wrong

@Broberto I believe you are right - 2 things

  1. I was doing on mounted on the container holding the select not on the select
  2. I was doing most of my testing clicking the weweb refresh button, but it seems to only work with refreshing the whole browser page.

It seems to work now :slight_smile: Maybe #2 is a feature request… :thinking: