Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

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: 2 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

Lists

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


NPM Version
Twitter

## 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