chore: use width property
This commit is contained in:
parent
40f7871f1b
commit
ecaa09285b
1 changed files with 20 additions and 20 deletions
|
@ -1,24 +1,24 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="gantt-container">
|
<div class="gantt-container">
|
||||||
<div :style="{'width': ganttChartWidth + 'px'}">
|
<g-gantt-chart
|
||||||
<g-gantt-chart
|
:chart-start="`${dateFrom} 00:00`"
|
||||||
:chart-start="`${dateFrom} 00:00`"
|
:chart-end="`${dateTo} 23:59`"
|
||||||
:chart-end="`${dateTo} 23:59`"
|
:precision="precision"
|
||||||
:precision="precision"
|
bar-start="startDate"
|
||||||
bar-start="startDate"
|
bar-end="endDate"
|
||||||
bar-end="endDate"
|
:grid="true"
|
||||||
:grid="true"
|
@dragend-bar="updateTask"
|
||||||
@dragend-bar="updateTask"
|
@dblclick-bar="openTask"
|
||||||
@dblclick-bar="openTask"
|
font="'Open Sans', sans-serif"
|
||||||
>
|
:width="ganttChartWidth + 'px'"
|
||||||
<g-gantt-row
|
>
|
||||||
v-for="(bar, k) in ganttBars"
|
<g-gantt-row
|
||||||
:key="k"
|
v-for="(bar, k) in ganttBars"
|
||||||
label=""
|
:key="k"
|
||||||
:bars="bar"
|
label=""
|
||||||
/>
|
:bars="bar"
|
||||||
</g-gantt-chart>
|
/>
|
||||||
</div>
|
</g-gantt-chart>
|
||||||
</div>
|
</div>
|
||||||
<form
|
<form
|
||||||
@submit.prevent="createTask()"
|
@submit.prevent="createTask()"
|
||||||
|
@ -82,7 +82,7 @@ const ganttChartWidth = computed(() => {
|
||||||
const from = parse(props.dateFrom, 'yyyy-LL-dd', new Date())
|
const from = parse(props.dateFrom, 'yyyy-LL-dd', new Date())
|
||||||
const to = parse(props.dateTo, 'yyyy-LL-dd', new Date())
|
const to = parse(props.dateTo, 'yyyy-LL-dd', new Date())
|
||||||
const dateDiff = Math.floor((to - from) / (1000 * 60 * 60 * 24))
|
const dateDiff = Math.floor((to - from) / (1000 * 60 * 60 * 24))
|
||||||
|
|
||||||
return dateDiff * DAY_WIDTH_PIXELS
|
return dateDiff * DAY_WIDTH_PIXELS
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue