English
fs-icon
About 213 wordsLess than 1 minute
fs-icon Icon Component
The icon component supports both iconfont font icons and HTTP-link images. It automatically identifies the type based on the name property.
Usage
Local import. Configure it in the index.json of the page or component where it is needed.
"usingComponents": {
"fs-icon": "ava-ui/fxui/fs-icon/index"
}Code Demo
Basic Usage
API
Properties
| Property Name | Type | Default | Description |
|---|---|---|---|
| name | String | '' | Icon name (iconfont class name or HTTP link) |
| size | String/Number | '' | Icon size, supports units such as rpx and px |
| color | String | '' | Icon color |
| extStyle | String | '' | External style |
Events
| Event Name | Description | Parameter |
|---|---|---|
| click | Click event | event |
Usage Examples
iconfont icon
<fs-icon name="time-2" size="48" color="#ff6600"></fs-icon>Image icon
<!-- https link -->
<fs-icon name="https://example.com/icon.png" size="48"></fs-icon>
<!-- http link -->
<fs-icon name="http://example.com/icon.png" size="48"></fs-icon>Automatic Identification Rules
- Strings starting with
http://orhttps://are recognized as image links - Other strings are recognized as iconfont class names
