1.0.6 • Published 4 years ago

vue-twentytwenty-one v1.0.6

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

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

PropsDescriptionRequiredTypeDefault
beforeURL of before imagetrueString-
beforeLabelWhen hovering over image what label should show up over before imagefalseString-
afterURL of after imagetrueString-
afterLabelWhen hovering over image what label should show up over after imagefalseString-
valueHow far from the left the slider should be on load (between 0 and 1)falseNumber0.5
keyboardStepHow far the slider should be moved on arrow key press (between 0 and 1)falseNumber0.2
lockLocks the 20-20, so the offset can't be changedfalseBooleanfalse

Events

EventDescription
inputTriggered when the offset changes
clickTriggered if the Twentytwenty is clicked without moving the slider
1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago