Complete the code to create a basic Vue app instance.
const app = Vue.[1]({ data() { return { message: 'Hello SSR!' }; } });
Vue apps are created using createApp. This sets up the app instance.
Complete the code to mount the Vue app to the DOM.
app.[1]('#app');
The mount method attaches the Vue app to a DOM element.
Fix the error in the server entry file to enable SSR rendering.
import App from './App.vue'; export function createApp() { const app = [1](App); return { app }; }
For SSR, Vue provides createSSRApp to create the app instance suitable for server rendering.
Fill both blanks to complete the Vue SSR server setup.
import { [1] } from 'vue/server-renderer'; import { createSSRApp } from 'vue'; export async function render(url) { const app = createSSRApp({ /* root component */ }); const html = await [2](app); return html; }
renderToString from vue/server-renderer converts the app to HTML string for SSR.
Fill all three blanks to complete a Vue SSR hydration example.
import { [1] } from 'vue'; import App from './App.vue'; const app = [2](App); app.[3]('#app');
For hydration on client side, use createSSRApp and hydrate to attach Vue to server-rendered HTML.
