Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit af1b144

Browse files
committed
feat(Nuxt): Integrate vue-transition-a11y in to example page
1 parent 537e97b commit af1b144

File tree

1 file changed

+37
-29
lines changed

1 file changed

+37
-29
lines changed

examples/with-nuxt/pages/index.vue

+37-29
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,47 @@
11
<template>
22
<div class="container">
3-
<div>
4-
<logo />
5-
<h1 class="title">
6-
with-nuxt
7-
</h1>
8-
<h2 class="subtitle">
9-
Example project with Nuxt.js and vue-transition-ay11
10-
</h2>
11-
<div class="links">
12-
<a
13-
href="https://nuxtjs.org/"
14-
target="_blank"
15-
class="button--green"
16-
>
17-
Documentation
18-
</a>
19-
<a
20-
href="https://github.com/nuxt/nuxt.js"
21-
target="_blank"
22-
class="button--grey"
23-
>
24-
GitHub
25-
</a>
3+
<TransitionA11y appear name="fade">
4+
<div v-if="loaded">
5+
<logo />
6+
<h1 class="title">with-nuxt</h1>
7+
<h2 class="subtitle">Example project with Nuxt.js and vue-transition-ay11</h2>
8+
<div class="links">
9+
<a href="https://nuxtjs.org/" target="_blank" class="button--green">Documentation</a>
10+
<a href="https://github.com/nuxt/nuxt.js" target="_blank" class="button--grey">GitHub</a>
11+
</div>
2612
</div>
27-
</div>
13+
</TransitionA11y>
2814
</div>
2915
</template>
3016

3117
<script>
32-
import Logo from '~/components/Logo.vue'
33-
import Transition from 'vue-transition-a11y'
18+
import Logo from '~/components/Logo.vue';
19+
import Transition from 'vue-transition-a11y';
3420
3521
export default {
22+
data() {
23+
return {
24+
loaded: false,
25+
};
26+
},
27+
3628
components: {
37-
Logo
38-
}
39-
}
29+
Logo,
30+
TransitionA11y: Transition,
31+
},
32+
33+
mounted() {
34+
this.loaded = true;
35+
},
36+
};
4037
</script>
4138

4239
<style>
4340
.container {
4441
margin: 0 auto;
4542
min-height: 100vh;
4643
display: flex;
44+
flex-direction: column;
4745
justify-content: center;
4846
align-items: center;
4947
text-align: center;
@@ -70,4 +68,14 @@ export default {
7068
.links {
7169
padding-top: 15px;
7270
}
71+
72+
.fade-enter-active,
73+
.fade-leave-active {
74+
transition: opacity 5s;
75+
opacity: 1;
76+
}
77+
.fade-enter,
78+
.fade-leave-to {
79+
opacity: 0;
80+
}
7381
</style>

0 commit comments

Comments
 (0)