Skip to content

Commit e7356f0

Browse files
author
Luke Dawkes
committed
Add missing README details for setComplementRoute
1 parent f264c32 commit e7356f0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,22 @@ Vue.use(VueAnnouncer, {
8383
}, router)
8484
```
8585

86+
### Methods
87+
**Note: These methods are registered on the `$announcer` property injected into the Vue instance**
88+
89+
#### `$announcer.setComplementRoute(complementRoute)`
90+
91+
If you need to set the `complementRoute` option dynamically without reloading the application, for example if you're
92+
dynamically loading translations, you can use this method to update it.
93+
94+
```javascript
95+
export default {
96+
onTranslationsUpdated (translations) {
97+
this.$announcer.setComplementRoute(translations.complementRouteKey /* = 'ha cargado' */)
98+
}
99+
}
100+
```
101+
86102
### Custom message to each page (optional)
87103
You can set a property on the meta object, which will serve as information to get the message that will be announced to the screen reader on each page. e.g.:
88104
```javascript

0 commit comments

Comments
 (0)