Skip to content

Commit f6da0b6

Browse files
committed
button to show off axe re-running feature
1 parent 5de0b3a commit f6da0b6

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

demo/src/components/Logo.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<template>
22
<div>
3-
<img :src="src" role="oisduhuo">
3+
<img v-if="showAlt" :src="src" role="oisduhuo" alt="VueJS Logo">
4+
<img v-else :src="src" role="oisduhuo">
45
</div>
56
</template>
67

78
<script>
89
export default {
910
name: 'Logo',
10-
props: ['src']
11+
props: ['src', 'showAlt']
1112
}
1213
</script>

demo/src/pages/Home.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div>
3-
<logo :src="require('@/assets/logo.png')" />
3+
<logo :src="require('@/assets/logo.png')" :showAlt="showAlt" />
44
<h1 data-va="main header">{{ msg }}</h1>
55
<h2>Access Pages</h2>
66
<ul>
@@ -13,6 +13,9 @@
1313
</ul>
1414
<p>Number: {{num}}</p>
1515
<p>Each time the number updates it's running a debounce function to call `axe-core` again.<br />It will only run run the debounce once per 5 seconds or 1 second after the last call.</p>
16+
<p>Use this button to see the console update as you fix or break a11y rules.</p>
17+
<button v-if="!showAlt" @click="toggleLogoAltTag">Add an alt tag to the logo</button>
18+
<button v-else @click="toggleLogoAltTag">Remove the alt tag from the logo</button>
1619
</div>
1720
</template>
1821

@@ -27,7 +30,8 @@
2730
data () {
2831
return {
2932
msg: 'Welcome - Open your console',
30-
num: 0
33+
num: 0,
34+
showAlt: false
3135
}
3236
},
3337
mounted()
@@ -41,6 +45,11 @@
4145
this.num += 1;
4246
this.updateNumber();
4347
}, 500);
48+
},
49+
toggleLogoAltTag()
50+
{
51+
this.showAlt = !this.showAlt
52+
console.log('Wait for Axe to run again in 5 seconds')
4453
}
4554
}
4655
}

0 commit comments

Comments
 (0)