8

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?

Stromwerk
  • 710
  • 8
  • 18

1 Answers1

13

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.

farincz
  • 4,943
  • 1
  • 28
  • 38