Gathering detailed insights and metrics for vue-media
Gathering detailed insights and metrics for vue-media
Gathering detailed insights and metrics for vue-media
Gathering detailed insights and metrics for vue-media
@heroicons/vue
<p align="center"> <a href="https://heroicons.com" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/tailwindlabs/heroicons/HEAD/.github/logo-dark.svg"> <source media="(pref
@vue-start/media
media preview
vue-mq
Handle media queries easily & build responsive design with Vue
@fastkit/vue-media-match
Library for handling Type-safe media query breakpoint schemas in Vue applications.
npm install vue-media
Typescript
Module System
Node Version
NPM Version
JavaScript (56.9%)
Vue (43.1%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
191 Stars
27 Commits
12 Forks
3 Watchers
14 Branches
4 Contributors
Updated on Jan 31, 2025
Latest Version
1.1.1
Package Id
vue-media@1.1.1
Size
4.45 kB
NPM Version
5.3.0
Node Version
7.6.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Like react-media but for Vue.js, and this library is pretty small, it's 969 bytes after minified without gzip.
1yarn add vue-media
CDN: https://unpkg.com/vue-media/dist
1<template> 2 <div id="app"> 3 <media :query="{minWidth: 500}">bigger than 500px</media> 4 <media :query="{maxWidth: 500}">smaller than 500px</media> 5 </div> 6</template> 7 8<script> 9 import Media from 'vue-media' 10 // Component is automatically registered if using CDN. 11 export default { 12 components: { 13 Media 14 } 15 } 16</script>
The value of query
can also be a media query string like (max-width: 500px)
, for more info please see json2mq doc.
This component will only return the first one of child components.
1<template> 2 <media :query="{maxWidth: 600}"> 3 <h2>hello world</h2> 4 <my-other-component></my-other-component> <!-- this will not be use! --> 5 </media> 6</template>
Use the media-enter
and media-leave
events.
1<template> 2 <div> 3 <media 4 :query="{maxWidth: 600}" 5 @media-enter="mediaEnter" 6 @media-leave="mediaLeave" 7 > 8 <h2>Hello world</h2> 9 </media> 10 <h2 v-if="greaterThan600">I'm now wider than 600!</h2> 11 </div> 12</template> 13 14<script> 15import Media from 'vue-media' 16 17export default { 18 components: { 19 Media 20 }, 21 data() { 22 return { 23 greaterThan600: window.innerWidth > 600 24 } 25 }, 26 methods: { 27 mediaEnter(mediaQueryString) { 28 this.greaterThan600 = false 29 }, 30 mediaLeave(mediaQueryString) { 31 this.greaterThan600 = true 32 } 33 } 34} 35</script>
The first argument of the listener is a mediaQueryString like (min-width: 400px)
.
If you want to support legacy browsers (ie <= 10), please include a window.matchMedia
polyfill.
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
vue-media © egoist, Released under the MIT License.
Authored and maintained by egoist with help from contributors (list).
egoistian.com · GitHub @egoist · Twitter @_egoistlily
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 3/27 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
114 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More