Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(avatar): 无障碍朗读支持. (#1028) #1137

Merged
merged 6 commits into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/avatar/_example/action/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<view class="avatar-example">
<t-avatar-group max="5" cascading="left-up" size="medium">
<t-avatar wx:for="{{pics}}" wx:for-item="pic" wx:key="index" image="{{pic}}" bordered />
<t-avatar slot="collapseAvatar" icon="user-add" bindtap="onAddTap" bordered />
<t-avatar slot="collapseAvatar" icon="user-add" bindtap="onAddTap" bordered alt="点击添加" />
</t-avatar-group>
</view>
<view class="avatar-example">
<t-avatar-group max="5" size="medium">
<t-avatar wx:for="{{pics}}" wx:for-item="pic" wx:key="index" image="{{pic}}" bordered />
<t-avatar slot="collapseAvatar" icon="user-add" bindtap="onAddTap" bordered />
<t-avatar slot="collapseAvatar" icon="user-add" bindtap="onAddTap" bordered alt="点击添加" />
</t-avatar-group>
</view>
</view>
2 changes: 1 addition & 1 deletion src/avatar/_example/character-avatar/index.wxml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<view class="demo-avatar">
<view class="avatar-example">
<t-avatar t-class-content="external-class-content">A</t-avatar>
<t-avatar t-class-content="external-class-content" alt="字母A为名称">A</t-avatar>
LeeJim marked this conversation as resolved.
Show resolved Hide resolved
</view>
<view class="avatar-example">
<t-avatar shape="round" t-class-content="external-class-content">A</t-avatar>
Expand Down
2 changes: 2 additions & 0 deletions src/avatar/avatar.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<view
class="{{this.getAvatarOuterClass(classPrefix, size, shape, bordered)}} {{prefix}}-class-image "
style="{{this.getAvatarSizePx(size)}}"
aria-label="{{ alt || '头像'}}"
LeeJim marked this conversation as resolved.
Show resolved Hide resolved
aria-role="img"
>
<t-image
wx:if="{{image}}"
Expand Down