So how would I do something similar in K3? I thought of creating a route that outputs the data I needed and fetching it in the front end with AJAX, but that seems like a huge overkill.
I put something() as a placeholder. It can be any data.
I can’t use what you’ve proposed because I need the data at the front end of my plugin. The plugin uses a panel view. I need to pass some data to this panel view from the server. I.E. I need to pass server data to the Vue component.
I see. I agree with you, but it would be pretty inefficient to fetch a single static value with AJAX. If you look at the source of the rendered panel page, you see:
So the panel already uses this method to provide server data to the Vue app. Perhaps a feature could be implemented that allows you to add your own <script> tag. Or perhaps some key in the Kirby::plugin definition of the plugin where you can specify some values to be included in window.panel up top.