feat:initial commit
This commit is contained in:
@@ -8,4 +8,4 @@
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped></style>`
|
||||
<style scoped></style>`
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<template>
|
||||
<div class="profile-page">
|
||||
<h1>My Profile</h1>
|
||||
|
||||
<div v-if="userStore.user">
|
||||
<p><strong>Name:</strong> {{ userStore.user.name }}</p>
|
||||
<p><strong>Email:</strong> {{ userStore.user.email }}</p>
|
||||
<p><strong>Joined:</strong> {{ new Date(userStore.user.created_at).toLocaleString() }}</p>
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
<p>Loading... <b> 読み込み中 </b></p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { useUserStore } from '@/stores/user'
|
||||
import { onMounted } from 'vue'
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
onMounted(() => {
|
||||
if (!userStore.user) {
|
||||
userStore.fetchUser()
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.profile-page {
|
||||
max-width: 600px;
|
||||
margin: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user