Vue Userdisplay Form
08:57 16 May 2026

Title:

Vue 3 Composition API fetch returns undefined for nested session object properties

Body:

I am working on a Vue 3 component using the

My questions:

  1. In my backend, the /api/me endpoint sends back { session: req.session }. However, the user type is determined by an external function. Should I modify the backend response, or is there a cleaner way to map the fetched reactive properties in Vue?

  2. What is the best practice for handling a loading state in Vue 3 while the async onMounted fetch is still running, to prevent the UI from flashing empty values?

Any advice on improving this component would be appreciated!

vue.js