#Using the global Astro object in Vue components

1 messages · Page 1 of 1 (latest)

solar birch
#

Is it possible to access the global Astro object inside Vue components? In my case, I need access to "Astro.params". My current workaround is passing the Astro object down via props, but that's somewhat ugly.

scarlet stratusBOT
#
No-one around right now?

It looks like no-one has responded to your question yet. People might not be available right now or don’t know how to answer your question. Want an answer while you wait? Try asking our experimental bot in #1095492539085230272.

distant python
#

Unfortunately this is not possible, the Astro global is a server side variable and Vue runs on the client so it doesn't have access to the server

#

In this case using props to pass the params object to the client is the recommended approach