1.1.0 • Published 1 year ago

simple-vue-drag-directive v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

How to install ?

npm install simple-vue-drag-directive

How to use ?

After installing the package, you can import as ES Module:

<script setup>
    import { vDrag } from 'simple-vue-drag-directive'
</script>

<template>
    <your-component v-drag={}></your-component>
</template>

And now you can drag <your-compnonet></your-compnonet> everywhere!

All right, if you want more function, you can also give v-drag some value. Just like the following.

<template>
    <your-component v-drag="{limit: 0.5, draggingClassList:['draging']}"></your-component>
</template>
.draging {
    opacity: 0.5;
}
propertyvalue's typedefault valuedescription
limitnumber1This proporty is design to narrow down the range within which an mousedown event is useful. Assume the element with v-drag has a height of 100px ans a width of 100px and you set limit as 0.5, the area which can listen your mousedown event will be narrow down to 20px(height) x 100px(width).
draggingClassListstring Classes in the classList will be added to the dragging element, and will be removed when mouseup event emits.

About the project dictionary

the directive code is in the ./src/directive

How to start ther demo ?

npm run dev

If you have any good ideas, welcome to fork the project.

My email address is 1446909703@qq.com.

1.1.0

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago