Determines whether the document matches a given media query string.
The media query string to track.
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') } }) Copy
const matches = useMediaQuery('(hover: hover) and (pointer: fine)') watchEffect(() => { if (matches.value) { console.log('Media query matches') } })
Determines whether the document matches a given media query string.