Skip to content

组件契约

所有图标组件遵循同一契约:

  • 只渲染一个根 <svg>
  • 保留原始 viewBox、分组、路径、填充色和描边;
  • 标准 Vue 透传属性会落到根 SVG,包括 classstylewidthheightfillstrokerolearia-*data-* 和事件监听器;
  • 不定义包专用 Props、Emits、Slots 或 Expose 方法;
  • 导入阶段不访问浏览器对象,也不会产生全局注册副作用。

大多数单色图标可以使用 fill: currentColor 跟随文本颜色。多色插图内部明确声明的填充色保持不变。

名称合同