diff --git a/demo/demo.vue b/demo/demo.vue index bab9f60..23cc0ae 100644 --- a/demo/demo.vue +++ b/demo/demo.vue @@ -56,7 +56,7 @@ let id = 0; const ganttData = reactive([]); -for (let i = 0; i < 50; i++) { +for (let i = 0; i < 100; i++) { onAdd(); } @@ -64,20 +64,20 @@ ganttData[0].children = [ { id: ++id, name: 'sub-t' + id, - startDate: new Date(2020, 0, 1), - endDate: new Date(2020, 0, 5) + startDate: new Date(2023, 3, 1), + endDate: new Date(2023, 3, 5) }, { id: ++id, name: 'sub-t' + id, - startDate: new Date(2020, 0, 1), - endDate: new Date(2020, 0, 5), + startDate: new Date(2023, 3, 1), + endDate: new Date(2023, 3, 5), children: [ { id: ++id, name: 'sub-sub-t' + id, - startDate: new Date(2020, 0, 1), - endDate: new Date(2020, 0, 5) + startDate: new Date(2023, 3, 1), + endDate: new Date(2023, 3, 5) } ] } @@ -87,8 +87,8 @@ function onAdd() { ganttData.push({ id: ++id, name: 't' + id, - startDate: new Date(2020, 0, id), - endDate: new Date(2020, 0, id + 5) + startDate: new Date(2023, 3, id), + endDate: new Date(2023, 3, id + 5) }); } diff --git a/src/components/common/GanttBody.vue b/src/components/common/GanttBody.vue index 864d3a4..891b221 100644 --- a/src/components/common/GanttBody.vue +++ b/src/components/common/GanttBody.vue @@ -9,7 +9,26 @@ -
+
+ +
@@ -20,22 +39,25 @@ import useGanttWidth from '@/composables/useGanttWidth'; import useInView from '@/composables/useInView'; import useSlotsBox from '@/composables/useSlotsBox'; import useStyle from '@/composables/useStyle'; +import useToday from '@/composables/useToday'; import RowVue from './Row.vue'; const { $slotsBox } = useSlotsBox(); const { bodyHeight } = useStyle(); -const { ganttWidth } = useGanttWidth(); +const { ganttWidth, ganttColumnWidth } = useGanttWidth(); const { inView } = useInView(); +const { todayLeft, showToday } = useToday();