Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-media-loader-directive

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-media-loader-directive

Smart loads , , & background images

  • 0.5.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
3
Weekly downloads
 
Created
Source

Vue Media Loader Directive

Loads or background image with multiple sources, depending on the viewport width. Use the :media attribute to pass in an obj with keys low, medium, and high image sources.

Once the image is loaded, if will be set on the element and a class of media-loaded will be added.

You would use this package instead of, say, PictureFill because there is a single API for dealing with both img tags and css background images.

Usage:

  • Register the directive globally

    Vue.directive 'media-loader', require 'vue-media-loader-directive'

  • Single image source string. Just add this to any element you want to load

    v-media-loader='/img/temp-project-marquee-low.png'

  • Bundle of media sizes. Should be a JS object with keys low, medium, high

    img(v-if='marquee' v-media-loader :media='[YOUR_OBJECT_REFERENCE]')

FAQs

Package last updated on 20 Apr 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc