Skip to content

Commit

Permalink
fix: tree move api error
Browse files Browse the repository at this point in the history
  • Loading branch information
Lydanne committed Nov 13, 2020
1 parent e9eca4f commit aa852bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/tree/Tree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ function useDrag(props) {
start: null /* TreeNode */,
current: null /* TreeNode */,
last: null /* TreeNode */,
drop: '' /* String > inner | top | bottom */
drop: '' /* String => inner | top | bottom */
})
const handleDragStart = (node, e) => {
if (typeof props.allowDrag === 'function' && !props.allowDrag(node, e)) {
Expand Down
8 changes: 1 addition & 7 deletions packages/tree/entity/TreeNode.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { isGreatGrandfather } from '../libs/util'

const typeFlag = Symbol('TREE_NODE')

/**
Expand Down Expand Up @@ -427,11 +425,7 @@ export class TreeNode {
* @param {string} relative top, bottom, inner
*/
isAllowMove(target) {
if (
target === this ||
target === this.parent ||
isGreatGrandfather(target, this)
) {
if (target === this) {
return false
}

Expand Down

0 comments on commit aa852bc

Please sign in to comment.