You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40-51Lines changed: 40 additions & 51 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,9 @@ Imagine browsing pages (routes), receiving alerts and notifications, having a co
11
11
12
12
The [@vue-a11y/announcer@next](https://github.com/vue-a11y/vue-announcer/tree/next) (v3.*) for Vue 3 provides an easy way to really tell what’s going on in your application to people using screen readers.
13
13
14
-
> For vue-announcer version 2.* you can access [this link](https://github.com/vue-a11y/vue-announcer/tree/master)
If you need to set the `routeComplement` option dynamically without reloading the application, for example if you're dynamically loading translations, you can use this method to update it.
81
80
@@ -109,7 +108,7 @@ Key | Data Type | data | default |
109
108
`politeness` | String | polite, assertive, off | `polite` |
110
109
`complementRoute` | String | | `has loaded` |
111
110
112
-
###Custom announcer (object meta)
111
+
## Custom announcer (object meta)
113
112
114
113
You can customize the message by defining the announcer on the "meta" object for each specific route.
115
114
@@ -139,11 +138,11 @@ Key | Data Type | data | default
139
138
`skip` | Boolean | | false |
140
139
`routeComplement` | String | | `has loaded` or set at installation |
141
140
142
-
####Note
141
+
### Note
143
142
- The plug-in checks whether the message to be announced has been defined in the meta.announcer object, otherwise the document title to be loaded will be announced.
144
143
- The `@vue-a11y/announcer@next` uses the global after hooks `router.afterEach` to announce the route changes.
145
144
146
-
###Skip in specific route
145
+
## Skip in specific route
147
146
Necessary for dynamic content pages that require asynchronous data to compose the page title.
148
147
149
148
The skip property on the `meta.announcer` object is used to `skip` the automatic announcement made on the `router.afterEach`, that way you can announce when the asynchronous data is available.
@@ -153,7 +152,6 @@ For example:
153
152
In you [`routes.js`](/demo/src/router/routes.ts)
154
153
155
154
```js
156
-
// ...
157
155
{
158
156
name:'post',
159
157
path:'/posts/:id',
@@ -164,62 +162,53 @@ In you [`routes.js`](/demo/src/router/routes.ts)
164
162
}
165
163
}
166
164
}
167
-
// ...
168
165
```
169
166
170
-
In you [`Post.vue`](/demo/src/pages/Post.vue)
167
+
## ARIA live regions
171
168
172
-
```vue
173
-
<template>
174
-
<template v-if="post">
175
-
<h2>{{ post.title }}</h2>
176
-
<p>{{ post.body }}</p>
177
-
</template>
178
-
<template v-if="error">
179
-
<h2 class="msg-error">{{ error }}</h2>
180
-
</template>
181
-
</template>
169
+
"Using JavaScript, it is possible to dynamically change parts of a page without requiring the entire page to reload — for instance, to update a list of search results on the fly, or to display a discreet alert or notification which does not require user interaction. While these changes are usually visually apparent to users who can see the page, they may not be obvious to users of assistive technologies. ARIA live regions fill this gap and **provide a way to programmatically expose dynamic content changes in a way that can be announced by assistive technologies.**"
182
170
183
-
<script lang="ts">
184
-
import { defineComponent, ref } from 'vue'
185
-
import { useAnnouncer } from '@vue-a11y/announcer'
0 commit comments