Skip to content

Commit

Permalink
feat: 0.0.5,拖拽时,禁止触发页面滚动等默认事件
Browse files Browse the repository at this point in the history
  • Loading branch information
dengwb1991 committed Feb 13, 2023
1 parent 5d3d886 commit c522316
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.0.5
2023-02-13

拖拽时,禁止触发页面滚动等默认事件

## 0.0.4
2023-02-13

Expand Down
5 changes: 3 additions & 2 deletions dist/vue-directive-dragging.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* vue-directive-dragging v0.0.4
* vue-directive-dragging v0.0.5
* (c) 2023 dengwb
* @license MIT
*/
Expand Down Expand Up @@ -39,6 +39,7 @@ function install(Vue, options) {
}

function handleDragMove(event) {
event.preventDefault();
var left = event.touches[0].pageX - diffLeft;
var top = event.touches[0].pageY - diffTop;

Expand Down Expand Up @@ -70,7 +71,7 @@ function install(Vue, options) {

var index = {
install: install,
version: '0.0.4'
version: '0.0.5'
};

export default index;
5 changes: 3 additions & 2 deletions dist/vue-directive-dragging.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* vue-directive-dragging v0.0.4
* vue-directive-dragging v0.0.5
* (c) 2023 dengwb
* @license MIT
*/
Expand Down Expand Up @@ -45,6 +45,7 @@
}

function handleDragMove(event) {
event.preventDefault();
var left = event.touches[0].pageX - diffLeft;
var top = event.touches[0].pageY - diffTop;

Expand Down Expand Up @@ -76,7 +77,7 @@

var index = {
install: install,
version: '0.0.4'
version: '0.0.5'
};

return index;
Expand Down
4 changes: 2 additions & 2 deletions dist/vue-directive-dragging.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 73 additions & 1 deletion examples/app.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,76 @@
<template>
<div class="drag-dom"
<div class="content-box">
<div class="drag-dom"
@click="$_click"
v-dragging="{ prevent: false }"></div>
1111
1111
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
1111
1111
1111
1111
1111
1111
1111
1111
1111
1111
</div>

</template>

<script>
Expand All @@ -17,6 +86,9 @@ export default {
body {
position: relative;
user-select: none;
}
.content-box {
}
.drag-dom {
width: 100px;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-directive-dragging",
"version": "0.0.4",
"version": "0.0.5",
"description": "Implementing a drag-and-drop plugin based on the vue directive",
"main": "./dist/vue-directive-dragging.min.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function install (Vue, options) {
}

function handleDragMove (event) {
event.preventDefault()
const left = event.touches[0].pageX - diffLeft
const top = event.touches[0].pageY - diffTop

Expand Down

0 comments on commit c522316

Please sign in to comment.