BKWLD / vue-visual

Vue 2 image and video loader supporting lazy loading, background videos, fixed aspect ratios, low rez poster images, transitions, loaders, slotted content and more.
https://bkwld.github.io/vue-visual
MIT License
59 stars 7 forks source link
intersectionobserver lazy-loading loader srcset video-player vue

Vue Visual npm

Vue 2 image and video loader supporting lazy loading. Visual 2.x is a simplification of Version 1.x with a greater reliance on modern browser features (IntersectionObserver, object-fit, srcset, sizes, etc).

Examples at https://bkwld.github.io/vue-visual.

Installation

  1. Install the package: npm install --save vue-visual or yarn add vue-visual
  2. Register the component:
    import Vue from 'vue'
    import Visual from 'vue-visual'
    Vue.component('visual', Visual)
    import 'vue-visual/index.css'
  3. These polyfills are recommended for older browsers:

Usage

See the Storybook.

Props

A list of the component properties that may be set on the Visual component.

Assets

Size

Style

Loading

Video

Accessibility

Slots

Methods

Events

Contributing

Changes from 1.x

migrate-1.x.coffee shows an example of a functional component that migrates the old API to the new API.