mirror of
https://github.com/tenrok/vue-ganttastic.git
synced 2026-06-25 02:00:33 +03:00
fix: forgot sort after adding bar
This commit is contained in:
+8
-1
@@ -134,10 +134,17 @@ export default {
|
|||||||
)
|
)
|
||||||
let bar = {}
|
let bar = {}
|
||||||
bar[this.ganttChartProps.barStartKey] = time.format()
|
bar[this.ganttChartProps.barStartKey] = time.format()
|
||||||
bar[this.ganttChartProps.barEndKey] = time.add(this.getDefaultBarLength(), this.timeUnit).format()
|
bar[this.ganttChartProps.barEndKey] = time
|
||||||
|
.add(this.getDefaultBarLength(), this.timeUnit)
|
||||||
|
.format()
|
||||||
|
|
||||||
bar.ganttBarConfig = { handles: true }
|
bar.ganttBarConfig = { handles: true }
|
||||||
this.bars.push(bar)
|
this.bars.push(bar)
|
||||||
|
this.bars.sort((first, second) =>
|
||||||
|
moment(first[this.ganttChartProps.barStartKey]).diff(
|
||||||
|
second[this.ganttChartProps.barStartKey]
|
||||||
|
)
|
||||||
|
)
|
||||||
},
|
},
|
||||||
|
|
||||||
onMouseover() {
|
onMouseover() {
|
||||||
|
|||||||
Reference in New Issue
Block a user