Skip to content

Icon 图标

基于 lucide-vue-next 的图标组件,支持自定义名称、颜色、大小、线宽和加载动画。

基础用法

API

Props

属性说明类型默认值
name图标名称(lucide图标名)string-
size图标大小number24
color图标颜色stringcurrentColor
strokeWidth线条宽度number2
defaultClass自定义类名stringv-icon
load是否显示加载动画booleanfalse

图标名

图标名称请参考 lucide-vue-next 图标库,如 homeusersettings 等。

布局与用法对比 elmui

  • elmui 的 icon 组件通常通过 <el-icon><xxx /></el-icon> 组合使用,而本组件直接通过 name 属性指定图标名,使用更简洁:
vue
<!-- elmui 用法 -->
<el-icon><Home /></el-icon>

<!-- 本组件用法 -->
<VIcon name="home" />
  • 支持直接通过 colorsizestrokeWidth 属性自定义样式,无需额外样式覆盖。

依赖

本组件依赖 lucide-vue-next,支持所有 lucide 图标。


如需更多图标,请访问 lucide.dev/icons 查看全部图标名。