Skip to content

Commit

Permalink
fix: 🐛修正滑块宽度
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyjone committed Apr 29, 2023
1 parent 6926dcd commit a8fcfc0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
20 changes: 16 additions & 4 deletions demo/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div style="top: 20vh; width: 100%; height: 500px">
<x-gantt :data="ganttData" style="padding-left: 20vh">
<x-gantt-column label="group1">
<x-gantt-column prop="id" width="200px"></x-gantt-column>
<x-gantt-column prop="id" width="150px"></x-gantt-column>
<x-gantt-column label="group2">
<x-gantt-column
prop="name"
Expand All @@ -18,9 +18,21 @@

<div>div</div>

<x-gantt-column v-slot="scope" prop="标签3">{{
scope.row.startDate
}}</x-gantt-column>
<x-gantt-column v-slot="scope" prop="起始日期">
{{ scope.row.startDate.getMonth() + 1 }}-{{
scope.row.startDate.getDate()
}}
{{ scope.row.startDate.getHours() }}:{{
scope.row.startDate.getMinutes()
}}
</x-gantt-column>

<x-gantt-column v-slot="scope" prop="结束日期">
{{ scope.row.endDate.getMonth() + 1 }}-{{
scope.row.endDate.getDate()
}}
{{ scope.row.endDate.getHours() }}:{{ scope.row.endDate.getMinutes() }}
</x-gantt-column>

<x-gantt-slider prop="name"></x-gantt-slider>
</x-gantt>
Expand Down
2 changes: 1 addition & 1 deletion src/components/slider/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const sliderLeft = computed(
const sliderWidth = computed(
() =>
(props.data!.start.intervalTo(props.data?.end) / currentMillisecond.value) *
(props.data!.end.intervalTo(props.data?.start) / currentMillisecond.value) *
ganttColumnWidth.value
);
Expand Down

0 comments on commit a8fcfc0

Please sign in to comment.