vue-twentytwenty-one

1.0.6 • Public • Published

Vue-TwentyTwenty-One

npm npm vue2

A small component to quickly let users see the differences between 2 images. This is a fork of vue-twentytwenty.

Installation

$ npm install vue-twentytwenty-one

##git Usage

import 'vue-twentytwenty-one/dist/vue-twentytwenty-one.css';
import TwentyTwenty from 'vue-twentytwenty-one';

export default {
  // ...
  components: {
    TwentyTwenty
  },
  data() {
    return {
      offset: 0.5
    }
  }
  // ...
};

It can then be used like so:

<TwentyTwenty
  v-model="offset"
  before="//placehold.it/600x200/E8117F/FFFFFF"
  after="//placehold.it/600x200/CCCCCC/FFFFFF" />

Props

Props Description Required Type Default
before URL of before image true String -
beforeLabel When hovering over image what label should show up over before image false String -
after URL of after image true String -
afterLabel When hovering over image what label should show up over after image false String -
value How far from the left the slider should be on load (between 0 and 1) false Number 0.5
keyboardStep How far the slider should be moved on arrow key press (between 0 and 1) false Number 0.2
lock Locks the 20-20, so the offset can't be changed false Boolean false

Events

Event Description
input Triggered when the offset changes
click Triggered if the Twentytwenty is clicked without moving the slider

Readme

Keywords

none

Package Sidebar

Install

npm i vue-twentytwenty-one

Weekly Downloads

1

Version

1.0.6

License

MIT

Unpacked Size

620 kB

Total Files

14

Last publish

Collaborators

  • kauto