device icon indicating copy to clipboard operation
device copied to clipboard

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

Open dyarfi opened this issue 4 years ago • 0 comments

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

dyarfi avatar Jul 17 '21 15:07 dyarfi