el-table-horizontal-scroll

let el-table show horizontal scroll-bar at bottom
30,474 83
Install
npm install el-table-horizontal-scroll
Latest Version:1.2.5
Vue:2
Last Updated:Jun 12, 2024
Links: GitHub  ·  npm
Maintainer: mizuka

el-table-horizontal-scroll

let el-table show horizontal scroll-bar at bottom

support vue2 and vue3

中文文档

How to use

install

npm install el-table-horizontal-scroll

register directive

import horizontalScroll from 'el-table-horizontal-scroll'

# vue2
Vue.use(horizontalScroll)

# vue3
app.use(horizontalScroll)

or

import horizontalScroll from 'el-table-horizontal-scroll'

export default {
    directives: {
        horizontalScroll
    }
}

use

<el-table
  :data="data"
  v-horizontal-scroll
>
  <el-table-column
    fixed="left"
    label="a"
    prop="a"
  ></el-table-column>
  <el-table-column
    label="b"
    prop="b"
  ></el-table-column>
  <el-table-column
    label="c"
    prop="c"
  ></el-table-column>
  <el-table-column
    label="d"
    prop="d"
    width="1600"
  ></el-table-column>
</el-table>

props

you can use always or hover

default is hover, the bar will show when your mouse over the table

or you can change it to always, and make the bar always show

example

<el-table
  :data="data"
  v-horizontal-scroll="'always'"
>
  <el-table-column
    fixed="left"
    label="a"
    prop="a"
  ></el-table-column>
  <el-table-column
    label="b"
    prop="b"
  ></el-table-column>
  <el-table-column
    label="c"
    prop="c"
  ></el-table-column>
  <el-table-column
    label="d"
    prop="d"
    width="1600"
  ></el-table-column>
</el-table>

How to change scrollbar‘s height

.el-table-horizontal-scrollbarl

manual add style to this class

if you think the scroller is so small when hover, you can add this to the style

.el-table-horizontal-scrollbar:hover {
  transform: scaleY(1.5);
  filter: brightness(0.1);
  transform: scaleY(1.75) translateY(-10%);
}

Related Packages

zfs-component

basic components of zfs

6,473
@fsscxh/zfs-component

basic components of zfs

3,796
@cell-x/el-table-sticky

A set of directives for element-ui el-table to make table header, footer and hor...

3,003 110
otb-module

otb-module是基于现有的element-ui库进行的二次封装,简化组件的各自用法,将所有基础...

9,611
wkjp-list-page

Vue2 + ElementUI CommonListPage component

9,010

Version History

Version Released License
1.2.5
1.2.4
1.2.3
1.2.2
1.2.1