79612245

Date: 2025-05-08 11:23:14
Score: 1
Natty:
Report link

I had exactly the same problem. I suspect it is due to timing. In the parent component or page, it might be the case that you have an await to fetch the json-url string value. But the child components will render immediately, before the parameter value has been set. Thus you will not have the json-url property available immediately. However it will be set maybe half a second later, but then it is too late, because the onMounted method has already completed. Displaying the value in the DOM will show the correct value, because it updates once the value has been set in the parent. So this explains how you see the value but onMounted doesnt. To solve this you need to avoid rendering the child components, until you have loaded all the data that they need in the parent page or component.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: user2992180