Skip to content

Commit d6aa4d6

Browse files
author
pooya parsa
committed
chore: add playground
1 parent 5c8629c commit d6aa4d6

File tree

4 files changed

+76
-0
lines changed

4 files changed

+76
-0
lines changed

playground/nuxt.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
build: {
3+
extractCSS: true
4+
}
5+
}

playground/pages/about.vue

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<template>
2+
<div>
3+
<p>About</p>
4+
<NuxtLink to="/">
5+
Home page
6+
</NuxtLink>
7+
</div>
8+
</template>
9+
10+
<script>
11+
export default {
12+
data () {
13+
return {
14+
name: process.static ? 'static' : (process.server ? 'server' : 'client')
15+
}
16+
},
17+
18+
async setup () {
19+
await new Promise(resolve => setTimeout(resolve, process.server ? 100 : 500))
20+
return {}
21+
},
22+
23+
head: {
24+
title: 'About page'
25+
}
26+
}
27+
</script>
28+
29+
<style scoped>
30+
div {
31+
color: 'red'
32+
}
33+
</style>

playground/pages/custom.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<template>
2+
<div>
3+
<p>Custom: {{ $route.params }}</p>
4+
<NuxtLink to="/">
5+
Home page
6+
</NuxtLink>
7+
</div>
8+
</template>
9+
10+
<script>
11+
export default {
12+
}
13+
</script>

playground/pages/index.vue

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<template>
2+
<div>
3+
<p>Home</p>
4+
<NuxtLink to="/about">
5+
About Page
6+
</NuxtLink>
7+
<NuxtLink to="/hello">
8+
Hello Page
9+
</NuxtLink>
10+
<br>
11+
<button @click="n++">
12+
Increment {{ n }}
13+
</button>
14+
</div>
15+
</template>
16+
17+
<script>
18+
export default {
19+
data: () => ({ n: 0 }),
20+
head: {
21+
title: 'Home page'
22+
}
23+
24+
}
25+
</script>

0 commit comments

Comments
 (0)