vue el-table 滚动条样式设置(谷歌、火狐)

对于el-table滚动条的样式,webkit(谷歌为代表)和 moz(火狐)的设置是不同的,因此需要分别进行设置。

webkit(谷歌)

// 滚动条大小设置
::v-deep .el-table__body-wrapper::-webkit-scrollbar {
  /*纵向滚动条*/
  width: 5px;
  /*横向滚动条*/
  height: 5px;
}

// 滚动条滑块样式设置
::v-deep .el-table__body-wrapper::-webkit-scrollbar-thumb {
  background-color: #bfbfc0;
  border-radius: 5px;
}

// 滚动条背景样式设置
::v-deep .el-table__body-wrapper::-webkit-scrollbar-track {
  background: none;
}

// 表格横向和纵向滚动条对顶角样式设置
::v-deep .el-table__body-wrapper::-webkit-scrollbar-corner {
  background-color: #111;
}

// 去除滚动条上方多余显示
::v-deep .el-table__header .has-gutter th.gutter {
  display: none !important;
}

moz(火狐)

// Firefox滚动条样式设置
::v-deep .el-table__body-wrapper {
  overflow-y: scroll;
  scrollbar-color: #bebebf transparent;
  scrollbar-width: thin;
}

火狐目前只找到了 scrollbar-color 和 scrollbar-width 这两个属性,scrollbar-color 的第一个值是滚动条的颜色,第二个值是滚动条轨道背景色。

你可能感兴趣的:(Vue,vue,table,火狐,firefox,滚动条)