Skip to content
On this page

isMobile

Definition:

js
/**
 * Detect whether it is a mobile device
 * @returns Return a boolean value, where true indicates it is a mobile device, and false indicates it is not
*/

Demo

Is this a mobile device?

Usage Example

ts
import { onMounted, ref } from 'vue'
import { isMobile } from 'utils-snap-fn'

const ifMobile = ref()

onMounted(() => {
  ifMobile.value = isMobile()
})

Source Code

utils-snap-fn-docs