🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

next-vue-device-detector

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-vue-device-detector

A tiny device detector plugin of vue 3 for mobile

0.0.1
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

License: MIT npm type definitions npm

Next-vue-device-detector

next-vue-device-detector is a simple vue plugin to inspect the device type.

  • focus on mobile
  • vue 3 friendly
  • strong typed

Install

npm install next-vue-device-detector --save

Quick Start

import { createDeviceDetector } from "next-vue-device-detector";

export const device = createDeviceDetector()
createApp(App).use(device).mount('#app')

Methods

  • In Setup()
    const d = useDevice()
    console.log(d.android, "in setup");
  • Outside Setup()
import { createDeviceDetector } from "next-vue-device-detector";

export const device = createDeviceDetector()
createApp(App).use(device).mount('#app')
console.log(device.android);

API list

you can get the following properties under device

interface IDeviceDetector {
  ios: Boolean
  iphone: Boolean
  iphoneX: Boolean
  iPhoneXR: Boolean
  iPhoneXSMax: Boolean
  ipod: Boolean
  ipad: Boolean
  android: Boolean
  androidPhone: Boolean
  windows: Boolean
  mobile: Boolean
  dingding: Boolean //钉钉
  wechat: Boolean, // 微信
  wechatMiniApp: Boolean //微信小程序
}

eg. on iphoneX

const device = useDevice()

console.log(device.iphoneX) // true
console.log(device.ios) // true
console.log(device.android) // false

Contributors

Thanks goes to these wonderful people (emoji key):

Vincent Guo
Vincent Guo

💻 📖 🚇

This project follows the all-contributors specification. Contributions of any kind welcome!

Keywords

vue 3

FAQs

Package last updated on 05 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts