Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix 修复onMove返回值,无法阻止元素拖拽问题 #171

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

Guxingzhe
Copy link
Contributor

Sortable onMove方法中,会根据返回值做判断拖拽过程,元素的插入情况

// Event when you move an item in the list or between lists
onMove: function (/*Event/evt, /*Event/originalEvent) {
// Example: https://jsbin.com/nawahef/edit?js,output
evt.dragged; // dragged HTMLElement
evt.draggedRect; // DOMRect {left, top, right, bottom}
evt.related; // HTMLElement on which have guided
evt.relatedRect; // DOMRect
evt.willInsertAfter; // Boolean that is true if Sortable will insert drag element after target by default
originalEvent.clientY; // mouse position
// return false; — for cancel
// return -1; — insert before target
// return 1; — insert after target
// return true; — keep default insertion point based on the direction
// return void; — keep default insertion point based on the direction
},

Copy link

netlify bot commented Aug 2, 2024

Deploy Preview for vue-draggable-plus ready!

Name Link
🔨 Latest commit 81853c7
🔍 Latest deploy log https://app.netlify.com/sites/vue-draggable-plus/deploys/66ac6df087a7fa00088dd803
😎 Deploy Preview https://deploy-preview-171--vue-draggable-plus.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Alfred-Skyblue Alfred-Skyblue merged commit a9efab0 into Alfred-Skyblue:main Aug 5, 2024
4 checks passed
@Alfred-Skyblue
Copy link
Owner

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants