Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running on Nuxt.js head using this.$device.isDesktop #85

Open
dyarfi opened this issue Jul 17, 2021 · 0 comments
Open

Running on Nuxt.js head using this.$device.isDesktop #85

dyarfi opened this issue Jul 17, 2021 · 0 comments

Comments

@dyarfi
Copy link

dyarfi commented Jul 17, 2021

Hi, this is a great module, I try to use and test this on the Nuxt.js head using this.$device.isDesktop:

head() {
   const { $device } = this
   return {
      title: 'page title',
      ...($device.isDesktop && {
        script: [
          {
            innerHTML: 'structuredData',
            type: 'application/ld+json'
          }
        ]
      })
   }
}

The module only working on yarn dev not on build or generate even on yarn start. Am I missing something? well, my actual target was $device.isCrawler to load scripts only on bots engine (Not yet tested on live).

Tested on:
"nuxt": "^2.14.12"
"@nuxtjs/device": "^2.1.0"

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant