v-ctrl
An Vue abstract component for mouse dragging, i.e. the pattern below:
--down--move--move---move--...---up--|-->
Install
npm install --save v-ctrl # or yarn add v-ctrl
Or just add a script
tag in you html:
Demo
A simple range slider:
{{value}}
Attributes
throttle
: Number
Throttling time for mousemove.
direction
: Enum('v', 'h', 'vh')
h
: emit proportion for the horizontal axis, e.g.0.52
v
: emit proportion for the vertical axis, e.g0.91
vh
: emit proportion for both axis, e.g.{ x: 0.24, y: 0.87 }
Event
change
change
event is emitted while keeping dragging.