npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

el-table-enhance

v1.0.5

Published

Element UI Table增强类库,提供列高亮等功能

Downloads

32

Readme

El Table Enhance

Element UI 表格增强插件,为 Element UI 的 el-table 组件提供列高亮和可拖拽调整列宽功能。

功能特性

🎯 列高亮功能

  • 鼠标悬停时高亮整列(包括表头和表体)
  • 支持斑马纹表格

📏 列宽拖拽调整

  • 无需开启 border 属性即可调整列宽
  • 鼠标悬停列时显示拖拽手柄
  • 实时调整列宽,无需等待拖拽结束

效果展示

功能演示

安装

npm install el-table-enhance

使用方法

1. 全局注册插件

import Vue from 'vue'
import ElementUI from 'element-ui'
import ElTableEnhance from 'el-table-enhance' 

Vue.use(ElementUI)
Vue.use(ElTableEnhance)

2. 在组件中使用

<template>
  <el-table 
    :data="tableData" 
    highlightCol
    resizable
  >
    <el-table-column prop="name" label="姓名" />
    <el-table-column prop="age" label="年龄" />
    <el-table-column prop="address" label="地址" />
  </el-table>
</template>

<script>
export default {
  data() {
    return {
      tableData: [
        { name: '张三', age: 25, address: '北京市朝阳区' },
        { name: '李四', age: 30, address: '上海市浦东新区' },
        { name: '王五', age: 28, address: '广州市天河区' }
      ]
    }
  }
}
</script>

配置选项

el-table 新增属性

| 属性名 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | highlightCol | Boolean | false | 是否启用列高亮功能 | | resizable | Boolean | false | 是否启用列宽拖拽调整功能 |

样式自定义

列高亮样式

// 自定义列高亮颜色
.el-table .el-table-enhanced-col-hover {
  background-color: #your-color !important;
}

// 自定义表头高亮样式
.el-table th.el-table-enhanced-col-hover {
  background-color: #your-header-color !important;
  font-weight: 600;
}

拖拽手柄样式

// 自定义拖拽手柄样式
.el-table-resize-handle {
  background: #your-handle-color;
  width: 8px;
  
  &:hover {
    background: #your-hover-color;
  }
}

兼容性

  • Vue 2.6+

注意事项

  1. 列宽调整功能

    • 最后一列不支持调整宽度(避免表格布局问题)
    • 调整过程中会自动设置 table-layout: fixed
  2. 样式优先级

    • 插件使用 !important 确保样式生效
    • 如需自定义样式,请使用更高优先级的选择器

License

MIT