Home, I think I'm looking for this should be a critical to rely on the PHP template Rendering page and spa a transition between the plan, I intend to take this step by step changes are tested;
It is also a further reflection on the problem of http://segmentfault.com/q/1010000004067025.
1. Modular or single-file assembly?
On the server-side rendered page, using Vue's modular or .vue
single-file component to process the data, is the output full HTML? Or will it be uploaded to the client to render?
Mainly for the. Vue component, the data from PHP to the window (not directly embedded PHP data), tied to Vue, this will be on the server-side rendering it?
Modularity or can embed PHP data directly, that should still output HTML to it?
If you give the node layer to render is not directly out of the HTML?
2. Front-end Vue and Template Association method: Multi-blade template or a single blade template (PHP framework laravel Self-template engine)?
Render with multiple blade templates, but both contain the same portal, and then each time you call a different component to use, will you pack the extra components together? Is there a better way to do it?
Is it possible to render a page using a single blade template rendering, corresponding to multiple portals, and introducing different entrances to each of the different parameters each time?
The problems of 1 and 2 will go together, and the inside can cross, which is the better solution?
Thank you! May be a bit messy, want to try this transition plan concrete implementation of the scheme.
Reply content:
Home, I think I'm looking for this should be a critical to rely on the PHP template Rendering page and spa a transition between the plan, I intend to take this step by step changes are tested;
It is also a further reflection on the problem of http://segmentfault.com/q/1010000004067025.
1. Modular or single-file assembly?
On the server-side rendered page, using Vue's modular or .vue
single-file component to process the data, is the output full HTML? Or will it be uploaded to the client to render?
Mainly for the. Vue component, the data from PHP to the window (not directly embedded PHP data), tied to Vue, this will be on the server-side rendering it?
Modularity or can embed PHP data directly, that should still output HTML to it?
If you give the node layer to render is not directly out of the HTML?
2. Front-end Vue and Template Association method: Multi-blade template or a single blade template (PHP framework laravel Self-template engine)?
Render with multiple blade templates, but both contain the same portal, and then each time you call a different component to use, will you pack the extra components together? Is there a better way to do it?
Is it possible to render a page using a single blade template rendering, corresponding to multiple portals, and introducing different entrances to each of the different parameters each time?
The problems of 1 and 2 will go together, and the inside can cross, which is the better solution?
Thank you! May be a bit messy, want to try this transition plan concrete implementation of the scheme.
First, Vue is the client,
If you want to render Vue on the server,
It's not going to work, you have to go through Nodejs.
There are no officially recommended mature programs.
laravel
+ vue
is essentially:
laravel
blade
rendering the HTML through the engine,
Returns the appropriate script to be executed for vue
the client.
To solve is vue
not itself or inconvenient路由和权限验证
Using Node+vue.js to implement SPA applications, solving the biggest drawbacks of spa applications SEO before writing the article is now in the perfect project.
The. vue file does not load on the server so it is discarded.
Server-side rendering can be written with a 3rd party Vue-server plugin