Skip to content

Commit d645e20

Browse files
committed
feat: added prop scrollSpeed
1 parent a7fe198 commit d645e20

File tree

9 files changed

+125
-131
lines changed

9 files changed

+125
-131
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ export default {
104104
| `disabled` | `Boolean` | `false` | Disables the sortable if set to true |
105105
| `animation` | `Number` | `150` | Animation speed moving items when sorting |
106106
| `autoScroll` | `Boolean` | `true` | Automatic scrolling when moving to the edge of the container |
107+
| `scrollSpeed` | `Object` | `{ x: 10, y: 10 }` | Vertical&Horizontal scrolling speed (px) |
107108
| `scrollThreshold` | `Number` | `55` | Threshold to trigger autoscroll |
108109
| `delay` | `Number` | `0` | Time in milliseconds to define when the sorting should start |
109110
| `delayOnTouchOnly` | `Boolean` | `false` | Only delay on press if user is using touch |

dist/virtual-drag-list.js

Lines changed: 103 additions & 124 deletions
Large diffs are not rendered by default.

dist/virtual-drag-list.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/components/table.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default {
4949
<style scoped>
5050
.table-list {
5151
height: 500px;
52-
padding: 5px;
52+
padding: 0 5px;
5353
}
5454
5555
.list-item {

docs/guide/props.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,15 @@ Animation speed moving items when sorting
160160

161161
Automatic scrolling when moving to the edge of the container
162162

163+
## `scrollSpeed`
164+
165+
| **Type** | **Default** |
166+
| --------- | ----------------------- |
167+
| `Object` | `{ x: 10, y: 10 }` |
168+
169+
Vertical&Horizontal scrolling speed (px)
170+
171+
163172
## `scrollThreshold`
164173

165174
| **Type** | **Default** |

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-virtual-draglist",
3-
"version": "2.9.1",
3+
"version": "2.9.2",
44
"description": "A virtual scrolling list component that can be sorted by dragging",
55
"main": "dist/virtual-drag-list.min.js",
66
"files": [
@@ -36,7 +36,7 @@
3636
},
3737
"homepage": "https://github.com/mfuu/vue-virtual-drag-list#readme",
3838
"dependencies": {
39-
"sortable-dnd": "^0.6.15"
39+
"sortable-dnd": "latest"
4040
},
4141
"devDependencies": {
4242
"@babel/core": "^7.8.7",

src/core

src/item.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Vue from 'vue';
12
import { ItemProps } from './props';
23

34
const Item = Vue.component('virtual-list-item', {

src/props.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ export const VirtualProps = {
6767
type: Boolean,
6868
default: true,
6969
},
70+
scrollSpeed: {
71+
type: Object,
72+
default: () => ({ x: 10, y: 10 }),
73+
},
7074
scrollThreshold: {
7175
type: Number,
7276
default: 55,

0 commit comments

Comments
 (0)