Is it possible to pass variable from php script to javascript (twig for example, but it may be plain html with of course) on first page loading? I use vue cli and I can pass variable using ajax requests. At my previous application with knockout.js i just wrote something like
<script>
window.__initialServerData = {{ data|raw }};
console.log(__initialServerData);
</script>