@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 07:15 UTC

main
vue 32 lines 1015 Bytes
Raw
1 <script setup lang="ts">
2 useHead({ title: "Nuxt on Neon" });
3
4 const greeting = useState("greeting", () =>
5 import.meta.server ? (process.env.GREETING ?? "Hello!") : "Hello!",
6 );
7 const count = ref(0);
8 const responseGreeting = ref("");
9
10 async function loadGreeting() {
11 try {
12 const result = await $fetch<{ greeting: string }>("/api/hello?name=browser");
13 responseGreeting.value = result.greeting;
14 } catch {
15 responseGreeting.value = "Could not load the greeting. Try again.";
16 }
17 }
18 </script>
19
20 <template>
21 <main>
22 <h1 class="text-3xl font-bold">{{ greeting }}</h1>
23 <Card
24 title="Styled with Tailwind CSS"
25 body="This card is a Vue component styled with Tailwind utilities."
26 />
27 <button type="button" @click="count++">count: {{ count }}</button>
28 <button type="button" @click="loadGreeting">Load greeting</button>
29 <p role="status">{{ responseGreeting }}</p>
30 <NuxtLink class="mt-4 inline-block underline" to="/about">about (prerendered)</NuxtLink>
31 </main>
32 </template>