
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
github.com/ajerez/vue-mobile-detection
Version 2 of this plugin only works with Vue 3. If you need Vue 2 compatibility install version 1.0.0
Vue.js global function this.$isMobile()
that returns a Boolean value depending on whether or not the user is browsing with a mobile
https://ajerez.github.io/vue-mobile-detection/
npm i vue-mobile-detection
yarn add vue-mobile-detection
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 */
<template>
<div id="app">
<!-- Use in template -->
<div v-if="$isMobile()">MOBILE</div>
<div v-else>DESKTOP OR TABLET</div>
</div>
</template>
<script>
export default {
created() {
// Use in js
console.log(this.$isMobile());
}
};
</script>
This project is licensed under the terms of the MIT license
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.