其他分享
首页 > 其他分享> > 解决element-ui table fixed后滚动条问题

解决element-ui table fixed后滚动条问题

作者:互联网

<template>
    <el-table
      :data="tableData"
      class="table-fixed"
    >
        <el-table-column  prop="contractcode" fixed label="合同编号"> </el-table-column>
        <el-table-column  prop="contractcode" label="合同编号"> </el-table-column>
        <el-table-column  prop="contractcode" label="合同编号"> </el-table-column>
    </el-table>
</template>

<style lang="scss" rel="stylesheet/scss"  scoped>
    //这里用的 sass预编译器 
    .table-fixed ::v-deep .el-table__body-wrapper {
	    z-index: 2;
    }
    .table-fixed ::v-deep .el-table__fixed-right {
	    bottom: 13px !important;
	    right: 8px !important;
    }
    .table-fixed ::v-deep .el-table__fixed-body-wrapper {
	    padding-bottom: 13px !important;
    }
</style>

最好改一下全局滚动条样式

<template>
	<div id="app">
		<router-view />
	</div>
</template>
<style lang="scss" >
::-webkit-scrollbar {
  width: 8px;
  height: 13px;
  background-color: #F5F5F5;
}

/*定义滚动条轨道 内阴影+圆角*/
::-webkit-scrollbar-track {
  height: 8px;
  -webkit-box-shadow: inset 0 0 1px rgba(0, 0, 0, 0);
  border-radius: 10px;
  background-color: #F5F5F5;
}

//
/*定义滑块 内阴影+圆角*/
::-webkit-scrollbar-thumb {
  height: 8px;
  border-radius: 4px;
  -webkit-box-shadow: inset 0 0 6px rgba(208, 230, 250, .3);
  background-color: #c5daff;
}  
</style>

标签:__,el,element,滚动条,8px,ui,webkit,table,fixed
来源: https://blog.csdn.net/joebb/article/details/121766118