cr-avatar
A react component about custom avatar
view
Installation
npm install --save cr-avatar
Usage
import React PureComponent from 'react';import Avatar from 'cr-avatar';import 'cr-avatar/assets/index.css'; { console } { return <Avatar ='刘亦菲' ='#647BFC' ='line' = /> }
API
name | type | description |
---|---|---|
name | string | 名称 |
color | string | 颜色 |
mode | string | 组件模式(行内模式: 'line'; 头像模式: 'head') |
url | string | 头像URL |
onRemove | function | 点击删除回调 |
remove | bool | 可删除按钮配置(true : 有删除按钮, false : 没有删除按钮),默认值为true |
Development
git clone https://github.com/Fea-Sin/cr-avatar.git
cnpm install
npm start
Example
http://localhost:8018/examples/testOne.html
Test
npm test npm run coverage
License
cr-comp is released under the MIT license.