Skip to content

Partial static render for gradually shifting from traditional ssr web server to SPA #10832

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AlanYiNew opened this issue Nov 16, 2019 · 3 comments

Comments

@AlanYiNew
Copy link

What problem does this feature solve?

Currently I am trying to shift an existing website written in Django, a server side render web server written in python, to vue. I have already used prerender plugin to compile the SPA, but I have to use the generated static html files as template to the Django server, which means partials of the element is already rendered by the server and I don't want this portion to be affected (or controled) by vue. Since vue will replace this portion (, which is generated by Django) with the virtual DOM info generated when building the SPA with prerender plugin, so I am asking if there is a way that stop vue from updating some parts of the SPA or component and just keep those fraction as same as what is initially sent by the server.

What does the proposed API look like?

No matter under what circustance I will not be changed

//Layout is a component

@posva
Copy link
Member

posva commented Nov 16, 2019

You can use inline-template to let Vue reuse the content and have some kind of hybrid. People use different techniques that can be found in tutorials and forums.


Please, next time consider using the forum, the Discord server or StackOverflow for questions first. But feel free to come back and open an issue if it turns out to be a bug 🙂

@posva posva closed this as completed Nov 16, 2019
@AlanYiNew
Copy link
Author

You can use inline-template to let Vue reuse the content and have some kind of hybrid. People use different techniques that can be found in tutorials and forums.

Please, next time consider using the forum, the Discord server or StackOverflow for questions first. But feel free to come back and open an issue if it turns out to be a bug

Thank you very much. I have been looking around for a solution for this for a long time including searching stack overflow but could not find an approach, so I suspect that vue may not implement or support this feature from the mechanism basis. Thanks for your help and I will have a try.

@jacekkarczmarczyk
Copy link

@AlanYiNew keep in mind that inline templates might be removed in 3.0 vuejs/rfcs#98

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants