Refactor app.vue and [slug].vue: add scoped styles and optimize i18n usage

This commit is contained in:
2025-07-22 20:36:07 +02:00
parent 60b6f463dd
commit d0db0950c3
3 changed files with 7 additions and 4 deletions

View File

@@ -17,7 +17,7 @@ useHead({
</UApp> </UApp>
</template> </template>
<style> <style scoped>
body { body {
font-family: 'DM Sans', sans-serif; font-family: 'DM Sans', sans-serif;
} }

View File

@@ -1,4 +1,8 @@
@import "tailwindcss"; @import "tailwindcss";
@import "@nuxt/ui"; @import "@nuxt/ui";
@plugin "@tailwindcss/typography"; @plugin "@tailwindcss/typography";
body {
@apply bg-white dark:bg-neutral-950;
}

View File

@@ -8,8 +8,7 @@ const {
refresh, refresh,
} = await useAsyncData(`writings/${route.params.slug}/db`, () => $fetch(`/api/posts/${route.params.slug}`, { method: 'POST' })) } = await useAsyncData(`writings/${route.params.slug}/db`, () => $fetch(`/api/posts/${route.params.slug}`, { method: 'POST' }))
const { locale } = useI18n() const { t, locale } = useI18n({
const { t } = useI18n({
useScope: 'local', useScope: 'local',
}) })