Coding task · Vue.js course · Module 15: TypeScript & Nuxt

Practice: SSR-safe Code

Write a composable that safely uses window in an SSR context.

Task

Use onMounted to access window - an object unavailable on the server.