
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
const d = useDevice()
console.log(d.android, "in 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)
console.log(device.ios)
console.log(device.android)
Contributors
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!