Takeshi Tokugawa YD
Takeshi Tokugawa YD

Reputation: 1001

Is Nuxt.js (not pure Vue) check

Is there a way to check is Nuxt.js is being used?

Why I need to do it

For the UI frameworks development, herewith it's unknown will be used with Nuxt.js or just pure Vue. For example, depending on Vue or Nuxt, we need different link component:

<component is="isNuxt ? 'nuxt-link' : 'router-link'" />

What it the implementation of isNuxt method?

Upvotes: -1

Views: 163

Answers (1)

Cosimo Chellini
Cosimo Chellini

Reputation: 1730

I think the easy way could be:

const isNuxt = () => !!window.$nuxt

Upvotes: 2

Related Questions