Commit 9b8e9751 authored by danfuman's avatar danfuman

修改

parent d77cdaa7
......@@ -31,11 +31,11 @@
<div class="table-item">
<el-table
v-loading="tableLoading"
class="fixed-table"
:data="tableData"
element-loading-text="Loading"
@sort-change="sortChange"
border
fit
highlight-current-row
v-if="tableDataTotal > 0"
:default-sort = "{prop: 'gdp', order: 'descending'}"
......@@ -150,7 +150,23 @@
this.dataRegion()
this.getYears()
},
mounted() {
// window.addEventListener("scroll",this.scrolling)
},
beforeDestroy() {
// window.removeEventListener("scroll", this.scrolling);
},
methods: {
scrolling() {
let el = document.getElementsByClassName("el-table__fixed-header-wrapper")[0]
let scrollTop =window.pageYOffset ||document.documentElement.scrollTop ||document.body.scrollTop;
if (scrollTop>135){
let top = scrollTop-138
el.style.top = top+'px'
}else{
el.style.top = 0
}
},
getYears(){
getYears({}).then(res => {
this.yearOptions=res.data.reverse();
......@@ -385,6 +401,15 @@
}
}
::v-deep .el-table{
overflow:initial;
.el-table__header-wrapper{
position: sticky;
top:56px;
z-index: 9;
}
.el-table__fixed-header-wrapper{
z-index: 9;
}
th{
font-size: 12px !important;
font-weight: 400 !important;
......@@ -399,6 +424,9 @@
width: 10px;
}
}
::v-deep .fixed-table{
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment