Cannot read properties of undefined (reading 'isDesktop')
pit07 opened this issue · comments
Vincent Blondaux commented
Hi!
On Nuxt 2, I install the package
npm install -D @nuxtjs/device
I added '@nuxtjs/device', on the buildModules array (nuxt.config.js)
I just added this code to my page:
<div v-if="$device.isDesktop">
Desktop
</div>
<div v-else-if="$device.isTablet">
Tablet
</div>
<div v-else>
Mobile
</div>
And i have an error:
Cannot read properties of undefined (reading 'isDesktop')
Any ideas?
Thanks!
Damian Głowala commented
If installing Nuxt 2 version of the module doesn't work, let me know and I'll reopen this issue.