Thanks for some questions about how to use vuejs on the server side and hope to render the page on the server side.

Source: Internet
Author: User
On the homepage, I think I am looking for a transitional solution that is critical to relying on the php template to render the page and SPA. I plan to test the changes step by step; also following segmentfault. further thoughts on the issue of comq100000004067025; 1. modular...

On the homepage, I think I am looking for a transitional solution that is critical to relying on the php template to render the page and SPA. I plan to test the changes step by step;
It is also the further consideration of the problem of http://segmentfault.com/q/1010000004067025;

1. modular or single file componentization?
  • Use vue modularize or.vueA single file is componentized to process data. is the output complete Html? Or will it be uploaded to the client for rendering?

  • It is mainly for. vue componentized, and the php data is handed over to window (php data cannot be directly embedded) and bound to vue. Will this be rendered on the server side?

  • Modular or can php Data be directly embedded? should html be output?

  • If it is handed over to the node layer for rendering, is html directly generated?

2. how to associate the front-end vue with the Template: multiple blade templates or a single blade template (PHP framework laravel built-in template engine )?
  • If multiple Blade templates are used for rendering, but they all contain the same entry, and each time different components are called for use, will redundant components be packaged together? Is there a better way?

  • Is it feasible to use a single Blade template to render the page by introducing different portals based on different parameters each time for multiple portals?

Question 1 and question 2 will be combined, and the problem can be crossed. which is a better solution?

Thank you! It may be a bit messy. I 'd like to try the specific implementation scheme of this transition scheme.

Reply content:

On the homepage, I think I am looking for a transitional solution that is critical to relying on the php template to render the page and SPA. I plan to test the changes step by step;
It is also the further consideration of the problem of http://segmentfault.com/q/1010000004067025;

1. modular or single file componentization?
  • Use vue modularize or.vueA single file is componentized to process data. is the output complete Html? Or will it be uploaded to the client for rendering?

  • It is mainly for. vue componentized, and the php data is handed over to window (php data cannot be directly embedded) and bound to vue. Will this be rendered on the server side?

  • Modular or can php Data be directly embedded? should html be output?

  • If it is handed over to the node layer for rendering, is html directly generated?

2. how to associate the front-end vue with the Template: multiple blade templates or a single blade template (PHP framework laravel built-in template engine )?
  • If multiple Blade templates are used for rendering, but they all contain the same entry, and each time different components are called for use, will redundant components be packaged together? Is there a better way?

  • Is it feasible to use a single Blade template to render the page by introducing different portals based on different parameters each time for multiple portals?

Question 1 and question 2 will be combined, and the problem can be crossed. which is a better solution?

Thank you! It may be a bit messy. I 'd like to try the specific implementation scheme of this transition scheme.

First, the vue is from the client,
If you want to render vue on the server,
No. you have to get it through nodejs,
No mature solutions officially recommended yet.

laravel+vueEssentially:
laravelPassbladeThe engine renders html,
Return to the client for executionvue.

The solution is:vueIt is neither convenient nor convenient.Route and permission verification

Using node + vue. js to implement the SPA application solves the biggest drawback of the SPA application. the article previously written by SEO is now under the comprehensive project.

. Vue files cannot be loaded on the server, so they are no longer used,
The vue-server plug-in that can be written in 3rd for server rendering

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.