Skip to content

Commit de649e0

Browse files
committed
dx: playground improvements
1 parent 10cc14c commit de649e0

File tree

3 files changed

+126
-10
lines changed

3 files changed

+126
-10
lines changed

playground/nuxt.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ export default defineNuxtConfig({
22
modules: ['../src/module'],
33
devtools: { enabled: true },
44
compatibilityDate: '2025-05-13',
5+
nuxtifyCore: {
6+
brand: {
7+
tagline: 'This is a sample tagline for the pages module.',
8+
},
9+
},
510
nuxtifyPages: {
611
navigation: {
712
primary: [

playground/pages/index.vue

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<script setup lang="ts">
2+
import { useNuxtifyConfig, useServerSeoMeta } from '#imports'
3+
4+
// App state
5+
const nuxtifyConfig = useNuxtifyConfig()
6+
const dialog = useDialog()
7+
const toast = useToast()
8+
9+
// Page info
10+
useServerSeoMeta({
11+
title: `${nuxtifyConfig.brand?.name} playground`,
12+
description: `This is the ${nuxtifyConfig.brand?.name} playground.`,
13+
})
14+
15+
// Functions
16+
const clickDialog = () => {
17+
// Dialog
18+
dialog.value.title = 'This is a dialog!'
19+
dialog.value.message = 'It can have fun messages.'
20+
dialog.value.action.function = () => {
21+
dialog.value.show = false
22+
}
23+
dialog.value.show = true
24+
}
25+
const clickToast = () => {
26+
// Toast
27+
toast.value.message = 'This is a toast!'
28+
toast.value.show = true
29+
}
30+
</script>
31+
32+
<template>
33+
<v-container>
34+
<v-row>
35+
<v-col cols="12">
36+
<v-container>
37+
<v-row>
38+
<v-col cols="12">
39+
<h1>{{ nuxtifyConfig.brand?.name }} playground</h1>
40+
</v-col>
41+
</v-row>
42+
43+
<!-- Nuxtify config -->
44+
<v-row>
45+
<v-col cols="12">
46+
<v-card class="pa-4">
47+
<h2>nuxtifyConfig</h2>
48+
<pre>{{ nuxtifyConfig }}</pre>
49+
</v-card>
50+
</v-col>
51+
</v-row>
52+
53+
<!-- App dialog -->
54+
<v-row>
55+
<v-col cols="12">
56+
<v-card class="pa-4">
57+
<h2>AppDialog</h2>
58+
<v-btn
59+
class="mt-2"
60+
@click="clickDialog"
61+
>
62+
Show Dialog
63+
</v-btn>
64+
</v-card>
65+
</v-col>
66+
</v-row>
67+
68+
<!-- App toast -->
69+
<v-row>
70+
<v-col cols="12">
71+
<v-card class="pa-4">
72+
<h2>AppToast</h2>
73+
<v-btn
74+
class="mt-2"
75+
@click="clickToast"
76+
>
77+
Show Toast
78+
</v-btn>
79+
</v-card>
80+
</v-col>
81+
</v-row>
82+
83+
<!-- App loading -->
84+
<v-row>
85+
<v-col cols="12">
86+
<v-card class="pa-4">
87+
<h2>AppLoading</h2>
88+
<AppLoading />
89+
</v-card>
90+
</v-col>
91+
</v-row>
92+
93+
<!-- App logo -->
94+
<v-row>
95+
<v-col cols="12">
96+
<v-card class="pa-4">
97+
<h2>AppLogo</h2>
98+
<AppLogo />
99+
</v-card>
100+
</v-col>
101+
</v-row>
102+
</v-container>
103+
</v-col>
104+
</v-row>
105+
</v-container>
106+
</template>

playground/pages/test.vue

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,21 @@ const nuxtifyConfig = useNuxtifyConfig()
33
</script>
44

55
<template>
6-
<div>
7-
<h1>
8-
@nuxtify/pages module playground!
9-
</h1>
6+
<v-container>
7+
<v-row>
8+
<v-col cols="12">
9+
<h1>
10+
This is a test page that overrides the default dynamic page layout.
11+
</h1>
1012

11-
<v-btn>
12-
Test Button
13-
</v-btn>
13+
<div class="mt-4">
14+
This is the site tagline: <em>{{ nuxtifyConfig.brand.tagline }}</em>
15+
</div>
1416

15-
<h2>nuxtifyConfig</h2>
16-
<pre>{{ nuxtifyConfig }}</pre>
17-
</div>
17+
<v-btn class="mt-4">
18+
Test Button
19+
</v-btn>
20+
</v-col>
21+
</v-row>
22+
</v-container>
1823
</template>

0 commit comments

Comments
 (0)