SSR means the server sends fully rendered HTML to the browser. This helps pages load faster and improves search engine indexing because content is visible immediately.
Hydration is the process where Vue attaches event handlers and reactive data to the server-rendered HTML so the page becomes fully interactive without reloading.
The server includes the app's state as JSON inside the HTML. The client reads this to initialize its store, so the UI matches what was rendered on the server.
Hydration mismatch happens when the server and client render different HTML. This often occurs if code uses random numbers or current time during rendering.
import { createSSRApp } from 'vue' import App from './App.vue' export function createApp() { const app = createSSRApp(App) return { app } }
Vue SSR requires using createSSRApp from 'vue' and exporting a createApp function that returns the app instance inside an object.