# @beisen-cmps/ux-m-platform-avatar

> 用于展示头像

Latest version **0.0.6** (published 2018-07-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install @beisen-cmps/ux-m-platform-avatar
pnpm add @beisen-cmps/ux-m-platform-avatar
yarn add @beisen-cmps/ux-m-platform-avatar
bun add @beisen-cmps/ux-m-platform-avatar
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2018-07-30 |
| First published | 2018-06-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 108.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | beisen |
| Maintainers | beisencorp |
| Keywords | beisen, react-component, es6 |

## Links

- npm: https://www.npmjs.com/package/@beisen-cmps/ux-m-platform-avatar
- Repository: git@gitlab.beisencorp.com:ux-share-platform/ux-m-platform-avatar
- npm.io page: https://npm.io/package/@beisen-cmps/ux-m-platform-avatar

## Dependencies (4)

- [react](https://npm.io/package/react.md) ^15.6.2
- [react-dom](https://npm.io/package/react-dom.md) ^15.6.2
- [classnames](https://npm.io/package/classnames.md) ^2.1.3
- [react-tap-event-plugin](https://npm.io/package/react-tap-event-plugin.md) ^2.0.1

## Recent versions

- 0.0.6 (latest) — 2018-07-30
- 0.0.5 — 2018-06-19
- 0.0.4 — 2018-06-16
- 0.0.3 — 2018-06-15
- 0.0.2 — 2018-06-14
- 0.0.1 — 2018-06-14

## README

## 组件使用、扩展文档
# Avatar头像组件

用于展示头像

### UI规则

1. 按照不同尺寸显示对应大小的头像

2. 如果有头像图片，则显示图片

3. 如果没有头像图片，则显示成配置的color颜色

4. 如果没有配置color，则按照人员ID的最后一位数字从如下颜色中选取

   `['#FF7360' , '#349AF6','#8BDA44', '#4DD0E1','#00E099' ,'#FFC300'  ,'#FF9500']`

![Avatar](img/avatar.png)

### API

Avatar props

| name       | description                              | type     | default |
| ---------- | ---------------------------------------- | -------- | ------- |
| Id         | 人员ID                                     | String   | ''      |
| style      | 自定义container style                       | Object   | {}      |
| avatars    | {big: 'xxx', medium: 'xxx', original: 'xxx',small: 'xxx'} | Object   |         |
| mediaType  | default时，显示默认头像                          | String   | ''      |
| scale      | 头像尺寸  original small medium big                                   | String   |         |
| onTouchTap | 点击头像执行的操作                                | Function |         |
| color      | 头像颜色                                     | String   |         |
| hasAvatar  | 是否有头像详细的信息                               | Boolean  | false   |

---
_Source: https://npm.io/package/@beisen-cmps/ux-m-platform-avatar · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
