Avatar
You can use the avatar component to display avatars.
Sample code
See the sample codes in different languages:
.js
copy
{
"defaultTitle": "Avatar",
"usingComponents": {
"avatar": "mini-ali-ui/es/avatar/index"
}
}
.axml
copy
<view>
<!--normal avatar-->
<avatar src="xxxx" shape="standard"/>
<!--avatar with username and short description-->
<avatar src="xxxx" size="lg" name="username" desc="abstract description" shape="standard" />
</view>
Parameters
Property | Type | Description |
className | String | Customized class. |
src | String | Source of the avatar image. The default value is |
size | String | Avatar size. Valid values are:
The default value is |
shape | String | Avatar shape. Valid values are:
The default value is |
name | String | Username. |
desc | String | Short description about the user. |
onError | EventHandle | The event that is triggered when the avatar is failed to be loaded. The default value is |