mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-08 07:15:36 +00:00
no message
This commit is contained in:
parent
1ac069aba4
commit
31ef3a47e0
@ -12,18 +12,10 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
default: ""
|
default: ""
|
||||||
},
|
},
|
||||||
distanceLeft: {
|
|
||||||
type: Number,
|
|
||||||
default: -1 // 大于 -1 时 distanceRight 无效
|
|
||||||
},
|
|
||||||
distanceRight: {
|
distanceRight: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0
|
default: 0
|
||||||
},
|
},
|
||||||
distanceTop: {
|
|
||||||
type: Number,
|
|
||||||
default: -1 // 大于 -1 时 distanceBottom 无效
|
|
||||||
},
|
|
||||||
distanceBottom: {
|
distanceBottom: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 100
|
default: 100
|
||||||
@ -72,16 +64,8 @@ export default {
|
|||||||
this.left = window._DragBallComponent[this.id].left
|
this.left = window._DragBallComponent[this.id].left
|
||||||
this.top = window._DragBallComponent[this.id].top
|
this.top = window._DragBallComponent[this.id].top
|
||||||
} else {
|
} else {
|
||||||
if (this.distanceLeft > -1) {
|
this.left = this.clientWidth - this.floatDrag.offsetWidth - this.distanceRight;
|
||||||
this.left = this.distanceLeft;
|
this.top = this.clientHeight - this.floatDrag.offsetHeight - this.distanceBottom;
|
||||||
} else {
|
|
||||||
this.left = this.clientWidth - this.floatDrag.offsetWidth - this.distanceRight;
|
|
||||||
}
|
|
||||||
if (this.distanceTop > -1) {
|
|
||||||
this.top = this.distanceTop;
|
|
||||||
} else {
|
|
||||||
this.top = this.clientHeight - this.floatDrag.offsetHeight - this.distanceBottom;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.initDraggable();
|
this.initDraggable();
|
||||||
});
|
});
|
||||||
@ -154,7 +138,7 @@ export default {
|
|||||||
handleResize() {
|
handleResize() {
|
||||||
this.clientWidth = document.documentElement.clientWidth;
|
this.clientWidth = document.documentElement.clientWidth;
|
||||||
this.clientHeight = document.documentElement.clientHeight;
|
this.clientHeight = document.documentElement.clientHeight;
|
||||||
this.checkDraggablePosition();
|
this.$nextTick(this.checkDraggablePosition);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user