Answer the question
In order to leave comments, you need to log in
How to set the initial data for the js framework (Vue.js) in the php backend?
Let's say there is a page with a list of news. On the server side, the markup is rendered (including for Vue.js), then the script is connected, which already adds reactivity to everything, but what about the news directly?
Considered these options:
Answer the question
In order to leave comments, you need to log in
I will be banal - you need SSR , that is, Node.js + Vue.js on the server side. PHP is redundant here.
If at all, you can return a static page to which the framework will be attached, and statically load data via JSONP directly inline. Yes, the first thing the framework will do is re-render the tree house for you. He can be "persuaded" not to do this - read the link above " client side hydration ".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question