https://github.com/ajerez/vue-mobile-detection
Vue.js prototype function `this.$isMobile()` that returns a Boolean value depending on whether or not the user is browsing with a mobile
https://github.com/ajerez/vue-mobile-detection
ismobile mobile-detect mobile-detection vue vuejs
Last synced: 4 months ago
JSON representation
Vue.js prototype function `this.$isMobile()` that returns a Boolean value depending on whether or not the user is browsing with a mobile
- Host: GitHub
- URL: https://github.com/ajerez/vue-mobile-detection
- Owner: ajerez
- License: mit
- Created: 2019-03-25T11:42:08.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-10-29T10:21:11.000Z (about 4 years ago)
- Last Synced: 2024-04-24T13:27:38.499Z (over 1 year ago)
- Topics: ismobile, mobile-detect, mobile-detection, vue, vuejs
- Language: JavaScript
- Size: 575 KB
- Stars: 69
- Watchers: 5
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-vue - vue-mobile-detection - Vue.js prototype function `this.$isMobile()` that returns a Boolean value depending on whether or not the user is browsing with a mobile ` 📝 2 years ago` (UI Components [🔝](#readme))
- awesome-vue - vue-mobile-detection - Vue.js prototype function `this.$isMobile()` that returns a Boolean value depending on whether or not the user is browsing with a mobile. (Components & Libraries / UI Components)
- awesome-vue - vue-mobile-detection - Vue.js prototype function `this.$isMobile()` that returns a Boolean value depending on whether or not the user is browsing with a mobile. (UI Components / Form)
README
# IMPORTANT
**Version 2 of this plugin only works with Vue 3. If you need Vue 2 compatibility install version 1.0.0**
# vue-mobile-detection
Vue.js global function `this.$isMobile()` that returns a Boolean value depending on whether or not the user is browsing with a mobile
## Demo
https://ajerez.github.io/vue-mobile-detection/
## Installation
#### With npm (Recommended)
```bash
npm i vue-mobile-detection
```
#### yarn
```bash
yarn add vue-mobile-detection
```
## Usage
#### Plugin installation
```vue
import VueMobileDetection from "vue-mobile-detection";
import App from "./App.vue";
const app = createApp(App);
app.use(VueMobileDetection);
/* After the install you can use this.$isMobile() in all your vue components */
```
#### Using the plugin
```vue
MOBILE
DESKTOP OR TABLET
export default {
created() {
// Use in js
console.log(this.$isMobile());
}
};
```
## License
This project is licensed under the terms of the MIT license