@yesstudio/nuxt-composables
    Preparing search index...

    Function useMediaQuery

    • Determines whether the document matches a given media query string.

      Parameters

      Returns Readonly<Ref<boolean>>

      A readonly reference that indicates whether the document matches the media query.

      const matches = useMediaQuery('(hover: hover) and (pointer: fine)')

      watchEffect(() => {
      if (matches.value) {
      console.log('Media query matches')
      }
      })