Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
79 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
|
||
announcer: Announcer plugins page has loaded | ||
|
||
--- | ||
|
||
# Plugins | ||
|
||
Plugin is an interesting resource for you to create different ways to use the announcer and adapt to a specific problem in your app. | ||
|
||
|
||
```javascript | ||
// e.g. plugins/announcer/myPlugin.js | ||
export default { | ||
name: 'myPlugin', | ||
handler () { | ||
console.log('myPlugin') | ||
} | ||
} | ||
``` | ||
|
||
::: warning | ||
The handler function takes `$announcer` as a context (this), so you can use `this.assertive('my text')` | ||
::: | ||
|
||
```javascript | ||
// src/main.js | ||
import Vue from 'vue' | ||
import VueAnnouncer from '@vue-a11y/announcer' | ||
|
||
import myPlugin from '@plugins/announcer/myPlugin' | ||
|
||
Vue.use(VueAnnouncer, { | ||
plugins: [myPlugin] | ||
}) | ||
``` | ||
|
||
```javascript | ||
// e.g. component.vue | ||
export default { | ||
name: 'myComponent' | ||
|
||
methods: { | ||
test () { | ||
this.$announcer.plugins.myPlugin() | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default { | ||
name: 'spell', | ||
handler (pass) { | ||
if (pass) pass.split('').forEach((char, index) => setTimeout(() => this.polite(char), index * 100)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters