Skip to content

Commit 2e8d5f0

Browse files
authored
fix(minor): several minor bugs (#611)
* chore: env * fix(minor): removed dayjs and used vanilla javascript date * fix(minor): stringified avatar url to fix the problem with undefined
1 parent 29cf5bf commit 2e8d5f0

File tree

4 files changed

+7496
-9793
lines changed

4 files changed

+7496
-9793
lines changed

components/custom/Nav/user/User.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function signOutHandler() {
3131
<DropdownMenuTrigger as-child>
3232
<Button class="relative h-8 w-8 rounded-full" variant="ghost">
3333
<Avatar class="h-8 w-8">
34-
<AvatarImage :src="user?.imageUrl!" />
34+
<AvatarImage :src="String(user?.imageUrl!)" />
3535
<AvatarFallback>C</AvatarFallback>
3636
</Avatar>
3737
</Button>

nuxt.config.ts

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export default defineNuxtConfig({
2121
'nuxt-icon',
2222
'@nuxt/fonts',
2323
'nuxt-svgo',
24-
'dayjs-nuxt',
2524
'@sentry/nuxt/module',
2625
'@nuxt/image',
2726
],

pages/index.vue

+6-4
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ definePageMeta({
88
useHead({
99
title: 'Home | Enspire',
1010
})
11+
12+
const now = new Date().getHours()
1113
</script>
1214

1315
<template>
1416
<div class="text-3xl font-bold">
1517
{{
16-
$dayjs().hour() < 5 ? '晚上好!'
17-
: $dayjs().hour() < 12 ? '早上好!'
18-
: $dayjs().hour() < 13 ? '中午好!'
19-
: $dayjs().hour() < 18 ? '下午好!' : '晚上好!'
18+
now < 5 ? '晚上好!'
19+
: now < 12 ? '早上好!'
20+
: now < 13 ? '中午好!'
21+
: now < 18 ? '下午好!' : '晚上好!'
2022
}}
2123
</div>
2224
<div class="text-muted-foreground">

0 commit comments

Comments
 (0)