0.1.1 • Published 3 years ago
vue-is-mobile v0.1.1
vue-is-mobile
This is a little Vue library for detecting is user device mobile or tablet or desktop.
Installation
npm
npm i vue-is-mobile
yarn
yarn add vue-is-mobile
Usage
Installation
import VueIsMobile from "vue-is-mobile"
Vue.use(VueIsMobile)
Usage in component
<template>
<div id="app">
<div v-if="$isMobile">This is a mobile device, but not tablet</div>
<div v-if="$isMobileOrTablet">This is a mobile or tablet device</div>
</div>
</template>
<script>
export default {
mounted() {
console.log(this.$isMobile)
console.log(this.$isMobileOrTablet)
}
};
</script>
License
This project is licensed under the terms of the MIT license