JSPM

  • Created
  • Published
  • Downloads 13
  • Score
    100M100P100Q57014F
  • License MIT

独立的 teamix 图标组件

Package Exports

  • @teamix/icon

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@teamix/icon) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

teamix 图标组件

@teamix/icon

独立的 teamix 图标组件

API

TeamixIcon

参数名 说明 必填 类型 默认值 备注
type 图标类型 string
symbolPrefix iconfont.cn 项目前缀,可从项目信息中查看 优先级高于 setConfig 全局设置的 symbolPrefix
size 图标尺寸 'xxs' | 'xs' | 'small' | 'medium' | 'large' | 'xl' | 'xxl' | 'xxxl' |'inherit' 'medium'
style 设置组件样式 React.CSSProperties
className 设置组件类名 string

注:

  • 还可设置其他 html 元素属性,会透传到最外层的 DOM 结构上

TeamixIcon.setConfig

入参为一个对象

interface IOption {
  symbolPrefix?: string;
  scriptUrl: string;
}

默认内置 TeamixIcon.YUNXIAOTeamixIcon.HYBRIDCLOUD,即

// 云效
TeamixIcon.setConfig(TeamixIcon.YUNXIAO);

// 混合云
TeamixIcon.setConfig(TeamixIcon.HYBRIDCLOUD);
参数名 说明 必填 类型 默认值 备注
scriptUrl iconfont.cn 项目在线生成的 symbol js 地址 string
symbolPrefix iconfont.cn 项目前缀,可从项目信息中查看 string

注:

  • 在使用该组件时,一定要调用 TeamixIcon.setConfig 指定图标源信息
  • TeamixIcon.setConfig 每次调用会增加图标源(重复的不会添加),scriptUrl 后设置会覆盖前设置的值。如果不想被覆盖,可通过 scriptUrl 组件属性进行设置