2
0
mirror of https://github.com/tenrok/vue-ganttastic.git synced 2026-06-25 00:10:33 +03:00

feat: drag limit on left

This commit is contained in:
yicone
2021-01-29 22:25:37 +08:00
parent e259224b2c
commit 4ef8f27f53
+5 -1
View File
@@ -1,4 +1,4 @@
<template> <template>
<div> <div>
<div <div
class="g-gantt-bar" class="g-gantt-bar"
@@ -262,9 +262,13 @@ export default {
}, },
isPosOutOfDragRange(xStart, xEnd){ isPosOutOfDragRange(xStart, xEnd){
// 不能推动旁边的bar时,拖拽就不停止
if(!this.ganttChartProps.pushOnOverlap) { if(!this.ganttChartProps.pushOnOverlap) {
return false return false
} }
if(xStart && xStart < 0) {
return true
}
if(xStart && this.dragLimitLeft !== null && xStart < this.dragLimitLeft + this.getMinGapBetweenBars()){ if(xStart && this.dragLimitLeft !== null && xStart < this.dragLimitLeft + this.getMinGapBetweenBars()){
return true return true
} }