There is a little doubt about the rendering of vue ssr.

I have just started to contact the server rendering of vue. I have some questions. Here is a description of the problem:

first of all, the server rendering uses node to listen for the get request to obtain the request address to match the route acquisition component and generate the corresponding html string to return to the client, and then return it to the client for rendering.
the second point is that the root element is re-loaded with $mount (), at the end of the entery-client.js, and then the SPA rendered by the server on the first screen can be achieved.

< H2 > then comes the problem < / H2 >

what is sent from the server is only a string of html strings. I can understand that this is a static page without any interaction. When the page is loaded, it is client"s turn to perform $mount mount. After the load is successful, the client"s route will re-match the address and render (problem)

. Does

mean that there will be two renderings? Or is it that mount does not re-render, but just maps and binds elements to Vnode? However, the executed mount does not pass any identity to the vue.

finally, I would like to summarize the question: what is the execution process of app.$mount ("- sharpapp") after the string sent by the server is rendered, and what is the difference between app.$mount and non-ssr applications

so this is what I don"t quite understand. I hope all of you can give me an answer! Thank you


the client does not need to bind data, just bind the event

Menu