vue-device-detector
A tiny device detector plugin of vue for mobile
45,774
48
| Install | |
|---|---|
npm install vue-device-detector |
|
| Latest Version: | 1.1.6 |
| Vue: | 2 |
| License: | MIT |
| Last Updated: | Jan 3, 2023 |
| Links: | GitHub · npm |
Maintainer: dreambo8563
vue-device-detector

vue-device-detector is a simple vue plugin to inspect the device type.
- focus on mobile
- vue friendly
- strong typed
TODO:
- add dingding api
- add weixin api
Install
npm install vue-device-detector --save
Quick Start
import device from "vue-device-detector"
Vue.use(device)
Methods
- this.$device in Component context.
- Vue.$device in global.
API list
you can get the following properties under this.$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
console.log(this.$device.iphoneX) // true
console.log(this.$device.ios) // true
console.log(this.$device.android) // false
License
Contributors
Thanks goes to these wonderful people (emoji key):
| Vincent Guo💻 📖 🚇 |
|---|
This project follows the all-contributors specification. Contributions of any kind welcome!
Related Packages
Version History
| Version | Released | License |
|---|---|---|
| 1.1.6 | MIT | |
| 1.1.5 | MIT | |
| 1.1.4 | MIT | |
| 1.1.3 | MIT | |
| 1.1.2 | MIT | |
| 1.1.1 | MIT | |
| 1.1.0 | MIT | |
| 1.0.0 | MIT | |
| 0.1.7 | MIT | |
| 0.1.6 | MIT | |
| 0.1.5 | MIT | |
| 0.1.4 | MIT | |
| 0.1.3 | MIT | |
| 0.1.2 | MIT | |
| 0.1.1 | MIT |