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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@giszhc/tree-line-style

v0.0.1

Published

一个扩展El-Tree树组件连接线样式库

Readme

@giszhc/tree-line-style

一个扩展 Element Plus el-tree 树组件连接线样式的 CSS 库,让树组件的层级关系更加清晰美观。

✨ 特性

  • 🎨 自定义连接线颜色、宽度、样式
  • 🔧 可配置的节点缩进和横线长度
  • 📱 支持 dashed 和 solid 两种线型
  • 🚀 开箱即用,无需复杂配置
  • 💡 优化叶子节点的图标占位

📦 安装

npm install @giszhc/tree-line-style
# 或
pnpm add @giszhc/tree-line-style
# 或
yarn add @giszhc/tree-line-style

🚀 快速使用

在项目中引入样式后,直接在 el-tree 组件上添加类名即可:

<el-tree class="normal-tree-line-style" :data="data" />

⚙️ 自定义配置

通过 CSS 变量来自定义连接线的样式:

<el-tree 
  class="normal-tree-line-style"
  style="--tree-line-color: #409EFF; --tree-line-width: 2px;"
  :data="data" 
/>

可用的 CSS 变量

| 变量名 | 默认值 | 说明 | |--------|--------|------| | --tree-line-color | #DCDFE6 | 连接线颜色 | | --tree-line-width | 1px | 连接线宽度 | | --tree-line-style | dashed | 线条类型:dashed / solid | | --tree-node-padding | 16px | 节点缩进距离 | | --tree-horizontal-line-width | 20px | 横线长度 | | --tree-line-top | 18px | 横线距离节点顶部距离 | | --tree-line-left-offset | -2px | 连接线左偏移 | | --tree-no-icon-placeholder-size | 4px | 叶子节点图标占位大小 |

📝 完整示例

<el-tree 
  class="normal-tree-line-style"
  style="
    --tree-line-color: #67C23A;
    --tree-line-width: 2px;
    --tree-line-style: solid;
    --tree-node-padding: 20px;
  "
  :data="treeData" 
  :expand-on-click-node="false"
/>

🎯 注意事项

  1. 直接使用:直接在 el-tree 组件上添加 normal-tree-line-style 类名即可
  2. Element Plus 依赖:本库基于 Element Plus 的 el-tree 组件,请确保已安装并引入 Element Plus
  3. 样式优先级:如果与其他样式冲突,可以通过提高选择器优先级或使用 !important 解决

📄 许可证

MIT License

🤝 贡献

欢迎提交 Issue 和 Pull Request!


用心打造,专为 Element Plus 用户而作 ❤️