mirror of
https://github.com/VibedByKaKi/t3-code-android-nightly.git
synced 2026-10-11 12:51:15 +02:00
30 lines
890 B
Vue
30 lines
890 B
Vue
<script setup lang="ts">
|
|
// Title lives on the page so the dev test's hot-reload marker rewrite
|
|
// targets this file.
|
|
useHead({ title: "Nuxt on Hetzner" });
|
|
|
|
// SSR reads the Hetzner Server environment through the plain Node contract:
|
|
// `process.env`. `useState` serializes the server-read value into the
|
|
// payload so the client render matches.
|
|
const greeting = useState("greeting", () => {
|
|
if (import.meta.server) {
|
|
return typeof process.env.GREETING === "string"
|
|
? process.env.GREETING
|
|
: "Hello!";
|
|
}
|
|
return "Hello!";
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<main>
|
|
<h1 class="text-3xl font-bold">{{ greeting }}</h1>
|
|
<Card
|
|
title="Styled with Tailwind CSS"
|
|
body="This card is a Vue component styled with Tailwind utilities."
|
|
/>
|
|
<NuxtLink class="mt-4 inline-block underline" to="/about"
|
|
>about (prerendered)</NuxtLink
|
|
>
|
|
</main>
|
|
</template>
|