# cIcon组件
# 使用教程
# 使用文档
# 导入
main.js中:
import { cIcon } from 'cpm-ui'
Vue.use(cIcon)
1
2
2
# 调用
<!-- unicode渲染 -->
<cIcon render="unicode" type="" color="white" size="15px" @cIconClick="cIconClick"></cIcon>
<!-- font-class渲染 -->
<cIcon render="font-class" type="delete" color="white" size="2rem" @cIconClick="cIconClick"></cIcon>
<!-- symbol渲染 -->
<cIcon render="symbol" type="delete" color="white" size="2rem" @cIconClick="cIconClick"></cIcon>
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# 属性props
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---|---|---|---|---|
| render | 渲染方式 | String | unicode、font-class、symbol | font-class |
| type | icon类型 | String | 、check、close... | '' |
| size | icon大小 | String | 继承父级 | |
| color | icon颜色 | String | 继承父级 |
# 事件Event
| 方法 | 说明 |
|---|---|
| onClick | 点击icon |
如:
<cIcon type="delete" color="white" size="2rem" @onClick="onClick"></cIcon>
1
# 插槽slot
无
# 特别提示
无