current session info + some template refactor
This commit is contained in:
parent
f38d5c7d15
commit
b36c7c4da6
5 changed files with 108 additions and 45 deletions
40
src/views/PersonalView/PersonalMainBlock.vue
Normal file
40
src/views/PersonalView/PersonalMainBlock.vue
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<script setup>
|
||||
import { useAuthStore } from '@/stores/authStore.js'
|
||||
import { onMounted, ref } from 'vue'
|
||||
|
||||
const store = useAuthStore()
|
||||
|
||||
const userData = ref(null)
|
||||
|
||||
onMounted(() => {
|
||||
store.userInfo().then((data) => {
|
||||
userData.value = data
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-card :bordered="false" title="Main">
|
||||
<n-list hoverable clickable>
|
||||
<n-list-item>
|
||||
<n-thing title="Email" content-style="margin-top: 10px;">
|
||||
{{ userData?.email || '---' }}
|
||||
</n-thing>
|
||||
</n-list-item>
|
||||
|
||||
<n-list-item>
|
||||
<n-thing title="Username" content-style="margin-top: 10px;">
|
||||
{{ userData?.username || '---' }}
|
||||
</n-thing>
|
||||
</n-list-item>
|
||||
|
||||
<n-list-item>
|
||||
<n-thing title="Created At" content-style="margin-top: 10px;">
|
||||
{{ userData?.created_at || '---' }}
|
||||
</n-thing>
|
||||
</n-list-item>
|
||||
</n-list>
|
||||
</n-card>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
Loading…
Add table
Add a link
Reference in a new issue