Skip to content

Commit 77bbaf4

Browse files
committed
Docs: Example to vuepress projects
1 parent e8ce45b commit 77bbaf4

File tree

1 file changed

+39
-4
lines changed

1 file changed

+39
-4
lines changed

docs/demos/vuepress.md

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,42 @@
1-
---
2-
title: Example of how to use in a Vuepress application
1+
# Vuepress
2+
3+
Add the vue-announcer to your `enhanceApp.js`
4+
5+
```javascript
6+
import VueAnnouncer from "@vue-a11y/announcer";
7+
8+
export default ({ Vue, router, isServer }) => {
9+
if (!isServer) {
10+
Vue.use(VueAnnouncer, {}, router);
11+
}
12+
};
13+
```
14+
15+
Ok, now just insert the component `<VueAnnouncer />` in your main layout.
16+
17+
```vue
18+
<template>
19+
<div>
20+
<VueAnnouncer /> <!-- You can place it anywhere in your application -->
21+
...
22+
</div>
23+
</template>
24+
```
25+
26+
<br />
27+
328
---
429

5-
# Vuepress
30+
### Example using theme-default
31+
32+
<br />
33+
34+
<iframe
35+
src="https://codesandbox.io/embed/vue-announcer-vuepress-bp60e?fontsize=14&hidenavigation=1&module=%2F.vuepress%2FenhanceApp.js&theme=dark&view=editor"
36+
style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;"
37+
title="example vue-announcer to vuepress projects"
38+
allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr"
39+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
40+
></iframe>
641
7-
### Coming soon
42+
<a href="https://codesandbox.io/s/vue-announcer-vuepress-bp60e" target="_blank" rel="noopener">Open sandbox example</a>

0 commit comments

Comments
 (0)