Avatar 头像

概述

用来代表用户或事物,支持图片或字符展示。

使用指南

在 .json 中引入组件

  1. "usingComponents": {
  2. "i-avatar": "../../dist/avatar/index"
  3. }

示例

  1. <i-avatar size="small"></i-avatar>
  2. <i-avatar></i-avatar>
  3. <i-avatar size="large"></i-avatar>
  4. <i-avatar size="small" shape="square">A</i-avatar>
  5. <i-avatar shape="square">A</i-avatar>
  6. <i-avatar size="large" shape="square">A</i-avatar>
  7. <i-avatar src="https://i.loli.net/2017/08/21/599a521472424.jpg" size="small"></i-avatar>
  8. <i-avatar src="https://i.loli.net/2017/08/21/599a521472424.jpg" size="default"></i-avatar>
  9. <i-avatar src="https://i.loli.net/2017/08/21/599a521472424.jpg" size="large"></i-avatar>
  10. <i-avatar src="https://i.loli.net/2017/08/21/599a521472424.jpg" size="small" shape="square"></i-avatar>
  11. <i-avatar src="https://i.loli.net/2017/08/21/599a521472424.jpg" size="default" shape="square"></i-avatar>
  12. <i-avatar src="https://i.loli.net/2017/08/21/599a521472424.jpg" size="large" shape="square"></i-avatar>

API

Avatar properties

属性说明类型默认值
i-class自定义 class 类名String-
shape指定头像的形状,可选值为 circle、squareStringcircle
size设置头像的大小,可选值为 large、small、defaultStringdefault
src图片类头像的资源地址String-