A tiny device detector plugin of vue for mobile
npm install vue-device-detector





!npm type definitions
!npm


vue-device-detector is a simple vue plugin to inspect the device type.
- focus on mobile
- vue friendly
- strong typed
TODO:
- [x] add dingding api
- [x] add weixin api
``cmd`
npm install vue-device-detector --save
`js`
import device from "vue-device-detector"
Vue.use(device)
- this.\$device in Component context.
- Vue.\$device in global.
you can get the following properties under this.\$device
`ts`
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
`js``
console.log(this.$device.iphoneX) // true
console.log(this.$device.ios) // true
console.log(this.$device.android) // false

Thanks goes to these wonderful people (emoji key):
|
Vincent Guo
💻 📖 🚇") |
| :---: |
This project follows the all-contributors specification. Contributions of any kind welcome!