Detecting Server Side Rendering in Nuxt.js

Viewed 2085

I have a Nuxt.js app that uses Server Side Rendering. However in one of my pages I need to detect if it's SSR for a toggle of one of the components. What are some possible ways of creating an isSSR flag?

1 Answers

Use just

process.server

Vue exposes two attributes on process global variable. server and client and one of them is set true according to rendering side.

Related