Component value returns undefined on page load

msedge_VM0g7kVQFK

Components get mounted after your Workflow – the usual timing gotcha in Vue.js (which is what WeWeb runs on). They will initially return undefined, because the component is not mounted yet. This is a timing issue and not a bug. If you try logging the value with On mount on your Select component, it will give you the value always.

Usually what happens is:

  1. Page loads
  2. Your app’s JavaScript keeps getting processed
  3. Components mount

In your case:

  1. Page loads ← Here you log your component (which has not yet initialized)
  2. Your app’s JavaScript keeps getting processed
  3. Components mount ← Only here it gets available for example with On mount
3 Likes