From 3517dfae69846b92cd8103b8a19dd698c76eed5a Mon Sep 17 00:00:00 2001 From: TZGyn Date: Mon, 19 Jun 2023 06:13:26 +0800 Subject: [PATCH] Added Header.vue --- frontend/app.config.ts | 18 ++++++++++-------- frontend/components/Header.vue | 18 ++++++++++++++++++ frontend/components/PostCard.vue | 22 +++++++++++----------- frontend/pages/index.vue | 12 +++++++++--- frontend/tailwind.config.ts | 26 +++++++++++++------------- 5 files changed, 61 insertions(+), 35 deletions(-) create mode 100644 frontend/components/Header.vue diff --git a/frontend/app.config.ts b/frontend/app.config.ts index a39d4f2..620cd88 100644 --- a/frontend/app.config.ts +++ b/frontend/app.config.ts @@ -1,10 +1,12 @@ export default defineAppConfig({ - nuxtIcon: { - size: '24px', // default size applied - class: 'icon', // default class applied - aliases: { - nuxt: 'logos:nuxt-icon', - loading: 'svg-spinners:90-ring-with-bg', - }, - }, + nuxtIcon: { + size: '24px', // default size applied + class: 'icon', // default class applied + aliases: { + nuxt: 'logos:nuxt-icon', + loading: 'svg-spinners:90-ring-with-bg', + twitter: 'logos:twitter', + github: 'mdi:github', + }, + }, }) diff --git a/frontend/components/Header.vue b/frontend/components/Header.vue new file mode 100644 index 0000000..6af86af --- /dev/null +++ b/frontend/components/Header.vue @@ -0,0 +1,18 @@ + + + diff --git a/frontend/components/PostCard.vue b/frontend/components/PostCard.vue index 49bcd67..244c65f 100644 --- a/frontend/components/PostCard.vue +++ b/frontend/components/PostCard.vue @@ -1,21 +1,21 @@ diff --git a/frontend/pages/index.vue b/frontend/pages/index.vue index fc1d5fd..6051777 100644 --- a/frontend/pages/index.vue +++ b/frontend/pages/index.vue @@ -4,6 +4,7 @@ definePageMeta({ }) import { z } from 'zod' + type Posts = z.infer const posts = ref([]) @@ -29,6 +30,11 @@ const getPosts = async () => { lastPost.value = posts.value[posts.value.length - 1].sequence } +const logout = async () => { + await userLogout() + useRouter().push('/login') +} + onMounted(() => { getPosts() }) @@ -36,9 +42,9 @@ onMounted(() => {