vue-loader-exampleAfter the example, I plan to use this as the front end in the laravel framework, but I find that php data cannot be directly output in the. vue component as before, or what should I do?
Is it not directly used
.vueSingle file components, like
vue-webpack-exampleAs in, can php data be directly used in page templates by separating the three types of files? (Naturally, I know that this is not conducive to separation, and I want to change step by step in view of the current learning situation.)
If ajax is used to obtain all the data, even the full page refresh is obtained through secondary request, isn’t it bad?
If the front and back ends are separated instead of SPA, is it better to get api on the node layer to render the page, and can the data obtained from the Node layer be directly handed over to the. vue component for page rendering?
Then there is the problem of SPA, SEO have a better solution? Are there currently PJAX and Search Engine Optimization plans?
At present, the community already hasExplore PHP and Vue Common Direct Out Template Scheme
Php data is used directly in page templates
No matter how the front and back ends are separated, the data of the page still needs to be obtained from the background. There are two ways to get the data: 1. the backstage goes straight out 2.
ajax. Personal recommendation
Even full page refresh is obtained through secondary request, isn’t it bad?
On the whole, the advantages outweigh the disadvantages. Of course, this part of the request can be optimized, such as front-end cache data, first-screen data priority request rendering, back-end interface cache, etc.
You can consider server-side renderinghttps://ssr.vuejs.org/zh/In favor of
nodejs, the official support.
nodejsThe origin is quite deep, cooperate with each other, just like men and women work alone.