May 18, 2021 WeChat Mini Program Development Document
To better meet the access needs of visually impaired people for small programs, the base library supports some ARIA tags from 2.7.1.
The accessibility feature is accessible in read-screen mode, and iOS can be turned on via settings-universal-accessibility-and-narration.
In the case of view components, developers can add aria-role and aria-label properties. W here aria-role represents the role of the component, when set to 'img', the system reads out the 'image' when focused in read-screen mode. W hen set to 'button', the 'button' is read aloud after focusing. Aria-label represents the additional information that comes with the component and is read out automatically after focusing.
Small programs already have some barrier-free features built in, and for non-native components, developers can add the following barrier-free tags.
aria-hidden | aria-role | aria-label | aria-checked | aria-disabled |
aria-describedby | aria-expanded | aria-haspopup | aria-selected | aria-required |
aria-orientation | aria-valuemin | aria-valuemax | aria-valuenow | aria-readonly |
aria-multiselectable | aria-controls | tabindex | aria-labelledby | ria-orientation |
aia-multiselectable | aria-labelledby |
<view aria-role="button" aria-label="提交表单">提交</view>