1.0.8 • Published 4 years ago

cr-avatar v1.0.8

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

cr-avatar

A react component about custom avatar

view

HoverHoc

Installation

npm install --save cr-avatar

Usage

import React, { PureComponent } from 'react';
import Avatar from 'cr-avatar';
import 'cr-avatar/assets/index.css';

class App extends PureComponent {

  handleRemove = () => {
    console.log('删除回调')
  }

  render() {
    return (
      <Avatar
        name='刘亦菲'
        color='#647BFC'
        mode='line'
        onRemove={this.handleRemove}       
      />
    )
  }
}

API

nametypedescription
namestring名称
colorstring颜色
modestring组件模式(行内模式: 'line'; 头像模式: 'head')
urlstring头像URL
onRemovefunction点击删除回调
removebool可删除按钮配置(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.

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago