Skip to content

Commit

Permalink
chore(nuxt): enable ssr
Browse files Browse the repository at this point in the history
  • Loading branch information
hywax committed Jan 1, 2024
1 parent 2fd2dc0 commit 5e365a4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 25 deletions.
23 changes: 1 addition & 22 deletions components/Item.vue
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
<template>
<Suspense>
<template #default>
<Component :is="component" v-bind="props" />
</template>
<template #fallback>
<div class="p-4 flex gap-4">
<div class="flex-shrink-0 flex">
<div class="self-center w-16 h-16 overflow-hidden rounded-2xl border border-black/5 animate-pulse">
<div class="bg-fg-dimmed h-full w-full" />
</div>
</div>
<div>
<h3 class="animate-pulse text-lg mt-1">
<span class="inline-block min-h-[1em] w-[110px] flex-auto cursor-wait bg-fg-dimmed align-middle opacity-50 rounded" />
</h3>
<p class="animate-pulse text-sm text-black/50">
<span class="inline-block min-h-[1em] w-[160px] flex-auto cursor-wait bg-fg-dimmed align-middle opacity-50 rounded" />
</p>
</div>
</div>
</template>
</Suspense>
<Component :is="component" v-bind="props" />
</template>

<script setup lang="ts">
Expand Down
4 changes: 2 additions & 2 deletions components/service/Ping.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<ServiceBase v-bind="props">
<template #description>
<template v-if="data && data?.time >= 0">
<template v-if="data && data.time >= 0">
{{ $t('service.ping.description') }} <span class="border-b border-dashed">{{ data.time }} {{ $t('service.ping.units') }}</span>
</template>
<template v-else>
Expand All @@ -16,7 +16,7 @@ import type { PingService } from '~/types/services'
const props = defineProps<PingService>()
const { data, refresh } = await useFetch<{ time: number }>('/api/services/ping', { query: { id: props.id } })
const { data, refresh } = useFetch('/api/services/ping', { query: { id: props.id } })
const { pause } = useIntervalFn(refresh, props?.options?.interval || 10000, { immediate: true })
onBeforeUnmount(pause)
Expand Down
1 change: 0 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
ssr: false,
modules: [
'@nuxtjs/tailwindcss',
'@nuxtjs/color-mode',
Expand Down

0 comments on commit 5e365a4

Please sign in to comment.