qrcode
扫描二维码查看 H5 演示效果
qrcode
扫描二维码查看演示效果
taro-ui, 非 taro-ui-vue3
wxapp

Avatar 头像


用于展示用户头像

使用指南

在 Taro 文件中引入组件

import { AtAvatar } from 'taro-ui-vue3'

组件依赖的样式文件(仅按需引用时需要)

@import "taro-ui-vue3/dist/style/components/avatar.scss";

用法

<template>
  <view>
    <AtAvatar image='https://jdc.jd.com/img/200'></AtAvatar>
    <AtAvatar text='凹凸实验室'></AtAvatar>
    <AtAvatar circle image='https://jdc.jd.com/img/200'></AtAvatar>
    <AtAvatar circle text='凹凸实验室'></AtAvatar>
  </view>
</template>

Avatar 参数

微信H5参数说明类型可选值默认值
size头像大小Stringlarge, normal, smallnormal
circle头像是否圆形Boolean-false
image头像图片地址String--
text以文字形式展示头像String--
-openData参考微信开放数据Object{'{ type: \'userAvatarUrl\'}'}-

注意:openData 仅支持 type 为 userAvatarUrl