Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
npm
/
glsx-element-ui
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1c1a2fe3
authored
Nov 13, 2021
by
limin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改竖向滚动条不显示的问题
1 parent
426ac284
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
42 deletions
packages/table/src/table.vue
packages/table/src/table.vue
View file @
1c1a2fe
...
...
@@ -522,48 +522,6 @@ export default {
}
}),
// begin add limin
// 这个方法是当el-table设置max-height时,el-scroll height:100%失效,导致el-scroll-wrap的margin-right失效,所以给el-scroll设置height为max-height的高度
bodyScrollHeight
()
{
const
{
headerHeight
=
0
,
footerHeight
=
0
}
=
this
.
layout
;
if
(
this
.
maxHeight
)
{
const
maxHeight
=
parseHeight
(
this
.
maxHeight
);
if
(
typeof
maxHeight
===
"number"
)
{
return
{
height
:
maxHeight
-
footerHeight
-
(
this
.
showHeader
?
headerHeight
:
0
)
+
"px"
,
};
}
}
return
{
height
:
"100%"
};
},
// 这个方法就用到了scrollbarWidth,当el-table设置height为固定高度时,el-scroll-wrap的100%和固定高度一样,导致margin-bottom失效,这里直接把el-scroll-wrap的高度算好,是el-table固定高度加上滚动条宽度
bodyScrollWrapHeight
()
{
const
{
headerHeight
=
0
,
bodyHeight
,
footerHeight
=
0
}
=
this
.
layout
;
if
(
this
.
height
)
{
return
{
height
:
bodyHeight
?
bodyHeight
+
scrollbarWidth
()
+
"px"
:
""
,
};
}
else
if
(
this
.
maxHeight
)
{
const
maxHeight
=
parseHeight
(
this
.
maxHeight
);
if
(
typeof
maxHeight
===
"number"
)
{
return
{
height
:
maxHeight
-
footerHeight
-
(
this
.
showHeader
?
headerHeight
:
0
)
+
scrollbarWidth
()
+
"px"
,
};
}
}
return
{};
},
// end add limin
bindEvents
()
{
this
.
bodyWrapper
.
addEventListener
(
"scroll"
,
this
.
syncPostion
,
{
passive
:
true
,
...
...
@@ -750,6 +708,48 @@ export default {
},
// end add limin
// begin add limin
// 这个方法是当el-table设置max-height时,el-scroll height:100%失效,导致el-scroll-wrap的margin-right失效,所以给el-scroll设置height为max-height的高度
bodyScrollHeight
()
{
const
{
headerHeight
=
0
,
footerHeight
=
0
}
=
this
.
layout
;
if
(
this
.
maxHeight
)
{
const
maxHeight
=
parseHeight
(
this
.
maxHeight
);
if
(
typeof
maxHeight
===
"number"
)
{
return
{
height
:
maxHeight
-
footerHeight
-
(
this
.
showHeader
?
headerHeight
:
0
)
+
"px"
,
};
}
}
return
{
height
:
"100%"
};
},
// 这个方法就用到了scrollbarWidth,当el-table设置height为固定高度时,el-scroll-wrap的100%和固定高度一样,导致margin-bottom失效,这里直接把el-scroll-wrap的高度算好,是el-table固定高度加上滚动条宽度
bodyScrollWrapHeight
()
{
const
{
headerHeight
=
0
,
bodyHeight
,
footerHeight
=
0
}
=
this
.
layout
;
if
(
this
.
height
)
{
return
{
height
:
bodyHeight
?
bodyHeight
+
scrollbarWidth
()
+
"px"
:
""
,
};
}
else
if
(
this
.
maxHeight
)
{
const
maxHeight
=
parseHeight
(
this
.
maxHeight
);
if
(
typeof
maxHeight
===
"number"
)
{
return
{
height
:
maxHeight
-
footerHeight
-
(
this
.
showHeader
?
headerHeight
:
0
)
+
scrollbarWidth
()
+
"px"
,
};
}
}
return
{};
},
// end add limin
...
mapStates
({
selection
:
"selection"
,
columns
:
"columns"
,
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment