All Projects → ChanningDefoe → nuxt-mobile-detect

ChanningDefoe / nuxt-mobile-detect

Licence: MIT License
Nuxt mobile and device detection plugin for client side and SSR

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to nuxt-mobile-detect

task-manager
Open-source task manager based on Kanban. Made with vue.js, koa2, mongodb\mongoose.
Stars: ✭ 23 (-4.17%)
Mutual labels:  nuxt, nuxtjs
nuxt-i18n-boilerplate
A boilerplate for rapid application development using Nuxt i18n.
Stars: ✭ 20 (-16.67%)
Mutual labels:  nuxt, nuxtjs
nuxt-config
Nuxt.js全面配置(持续更新中……)
Stars: ✭ 67 (+179.17%)
Mutual labels:  nuxt, nuxtjs
website
My personal website and blog. Made with Nuxt.js and WindiCSS.
Stars: ✭ 19 (-20.83%)
Mutual labels:  nuxt, nuxtjs
awrora-starter
Landing page template built with one of most popular javascript library Vue.JS, Vuetify (Material Design) and Nuxt.JS with SSR.
Stars: ✭ 38 (+58.33%)
Mutual labels:  nuxt, nuxtjs
bodymoji
Draws an emoji on your face! Powered by Nuxt.js, Tensorflow.js and Posenet
Stars: ✭ 21 (-12.5%)
Mutual labels:  nuxt, nuxtjs
date-fns-module
Modern JavaScript date utility library - date-fns for Nuxt.js
Stars: ✭ 68 (+183.33%)
Mutual labels:  nuxt, nuxtjs
nuxt-prune-html
🔌⚡ Nuxt module to prune html before sending it to the browser (it removes elements matching CSS selector(s)), useful for boosting performance showing a different HTML for bots/audits by removing all the scripts with dynamic rendering
Stars: ✭ 69 (+187.5%)
Mutual labels:  nuxt, nuxtjs
nuxt-feature-toggle
The nuxt feature toggle module
Stars: ✭ 78 (+225%)
Mutual labels:  nuxt, nuxtjs
admin-one-nuxt
Admin One Nuxt - Nuxt.js Bulma Buefy admin dashboard
Stars: ✭ 23 (-4.17%)
Mutual labels:  nuxt, nuxtjs
isnuxt3ready
A community-built compatibility guide for Nuxt 3 modules
Stars: ✭ 106 (+341.67%)
Mutual labels:  nuxt, nuxtjs
nuxt-babel
Use normal .babelrc file with your Nuxt app
Stars: ✭ 32 (+33.33%)
Mutual labels:  nuxt, nuxtjs
nuxt-winston-log
Nuxt module for logging SSR errors using winston
Stars: ✭ 41 (+70.83%)
Mutual labels:  nuxt, nuxtjs
Ocelot-Social
Free and open-source social network for active citizenship.
Stars: ✭ 49 (+104.17%)
Mutual labels:  nuxt, nuxtjs
nuxt-mail
Adds email sending capability to a Nuxt.js app. Adds a server route, an injected variable, and uses nodemailer to send emails.
Stars: ✭ 62 (+158.33%)
Mutual labels:  nuxt, nuxtjs
yamlful
YAML-based HTTP client code generation
Stars: ✭ 77 (+220.83%)
Mutual labels:  nuxt, nuxtjs
nuxt-stencil
Easy Stencil.js component library integration with Nuxt.js.
Stars: ✭ 16 (-33.33%)
Mutual labels:  nuxt, nuxtjs
static-website
🖥 New Vue/Nuxt website for cdnjs.com - The #1 free and open source CDN built to make life easier for developers.
Stars: ✭ 47 (+95.83%)
Mutual labels:  nuxt, nuxtjs
nuxt-on-lambda
Nuxt.jsをAWS Lambdaで動かす
Stars: ✭ 78 (+225%)
Mutual labels:  nuxt, nuxtjs
separate-env-module
Tear your variables apart!
Stars: ✭ 53 (+120.83%)
Mutual labels:  nuxt, nuxtjs

📱 Nuxt Mobile Detect

nuxt-mobile-detect is a wrapper around mobile-detect.js for nuxtjs. It can be used client side and server side.

Note: @nuxtjs/device is another nuxt package for mobile device detection. nuxt-mobile-detect adds ~27.5kb of overhead and @nuxtjs/device only adds ~4.5kb, many projects won't need the full capabilities of mobile-detect.js and @nuxtjs/device would satisfy their use case.

Setup

  • Add nuxt-mobile-detect dependency using npm or yarn
npm i nuxt-mobile
yarn add nuxt-mobile
  • Add nuxt-mobile-detect to the modules section of nuxt.config.js
{
  modules: [
    'nuxt-mobile'
 ]
}

Usage

asyncData (server-side)

asyncData({app}) {
  let mobile = app.$mobileDetect.mobile()
}

methods/created/mounted/etc (client-side)

method() {
  let mobile = this.$mobileDetect.mobile()
}

Available Methods

For more information please refer to the mobile-detect.js github page.

Example User Agent

'Mozilla/5.0 (Linux; U; Android 4.0.3; en-in; SonyEricssonMT11i' +
    ' Build/4.1.A.0.562) AppleWebKit/534.30 (KHTML, like Gecko)' +
    ' Version/4.0 Mobile Safari/534.30'
console.log( this.$mobileDetect.mobile() );          // 'Sony'
console.log( this.$mobileDetect.phone() );           // 'Sony'
console.log( this.$mobileDetect.tablet() );          // null
console.log( this.$mobileDetect.userAgent() );       // 'Safari'
console.log( this.$mobileDetect.os() );              // 'AndroidOS'
console.log( this.$mobileDetect.is('iPhone') );      // false
console.log( this.$mobileDetect.is('bot') );         // false
console.log( this.$mobileDetect.version('Webkit') );         // 534.3
console.log( this.$mobileDetect.versionStr('Build') );       // '4.1.A.0.562'
console.log( this.$mobileDetect.match('playstation|xbox') ); // false
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].