Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vue-gantt
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨子
vue-gantt
Commits
0ddd6216
Commit
0ddd6216
authored
Jun 17, 2022
by
杨子
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化高度
parent
81746952
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
GGanttRow.vue
src/components/GGanttRow.vue
+10
-3
No files found.
src/components/GGanttRow.vue
View file @
0ddd6216
...
@@ -73,9 +73,16 @@ const isHovering = ref(false)
...
@@ -73,9 +73,16 @@ const isHovering = ref(false)
const
rowStyle
=
computed
(()
=>
{
const
rowStyle
=
computed
(()
=>
{
let
height
=
rowHeight
.
value
let
height
=
rowHeight
.
value
const
len
=
bars
.
value
.
filter
(
v
=>
v
.
ganttBarConfig
.
isCover
).
length
// 取出bars.value中ganttBarConfig.top属性的最大值
if
(
len
>
0
)
{
const
maxTop
=
bars
.
value
.
filter
(
v
=>
v
.
ganttBarConfig
.
isCover
).
reduce
((
acc
,
bar
)
=>
{
height
=
(
rowHeight
.
value
*
0.8
*
len
)
+
(
rowHeight
.
value
*
0.1
)
*
(
len
+
1
)
return
Math
.
max
(
acc
,
bar
.
ganttBarConfig
.
top
)
},
0
)
console
.
log
(
'maxTop'
,
maxTop
);
if
(
maxTop
>
0
)
{
height
=
(
rowHeight
.
value
*
0.8
*
maxTop
)
+
(
rowHeight
.
value
*
0.1
)
*
(
maxTop
+
1
)
}
}
return
{
return
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment