mirror of
https://github.com/creativetimofficial/vue-material-kit.git
synced 2025-05-23 21:04:21 +08:00
User profile page
This commit is contained in:
parent
c1e16406bc
commit
72d330e6db
@ -24,6 +24,7 @@ import ElProgressBars from "../layouts/sections/elements/progress-bars/ProgressB
|
|||||||
import ElToggles from "../layouts/sections/elements/toggles/TogglesView.vue";
|
import ElToggles from "../layouts/sections/elements/toggles/TogglesView.vue";
|
||||||
import ElTypography from "../layouts/sections/elements/typography/TypographyView.vue";
|
import ElTypography from "../layouts/sections/elements/typography/TypographyView.vue";
|
||||||
import Project from "../views/LandingPages/Project/Project.vue";
|
import Project from "../views/LandingPages/Project/Project.vue";
|
||||||
|
import Profile from "../views/LandingPages/Profile/Profile.vue";
|
||||||
|
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
@ -34,12 +35,19 @@ const router = createRouter({
|
|||||||
name: "presentation",
|
name: "presentation",
|
||||||
component: PresentationView,
|
component: PresentationView,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/project/:id',
|
path: '/project/:id',
|
||||||
name: 'project',
|
name: 'project',
|
||||||
component: Project
|
component: Project
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
path: '/profile/:id',
|
||||||
|
name: 'profile',
|
||||||
|
component: Profile
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: "/pages/landing-pages/about-us",
|
path: "/pages/landing-pages/about-us",
|
||||||
name: "about",
|
name: "about",
|
||||||
|
43
src/views/LandingPages/Profile/Profile.vue
Normal file
43
src/views/LandingPages/Profile/Profile.vue
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<script setup>
|
||||||
|
import axios from 'axios';
|
||||||
|
import { onMounted, ref } from "vue";
|
||||||
|
import { useRoute } from "vue-router";
|
||||||
|
|
||||||
|
|
||||||
|
const profileId = ref(null);
|
||||||
|
const route = useRoute();
|
||||||
|
const profileData = ref([]);
|
||||||
|
|
||||||
|
onMounted(async() => {
|
||||||
|
profileId.value = route.params.id;
|
||||||
|
await getProfile();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const getProfile = async () => {
|
||||||
|
const profileDataRecieved = await axios.get(`http://somebodyhire.me/api/profile/${profileId.value}/`);
|
||||||
|
profileData.value = profileDataRecieved.data;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<h1>Профиль пользователя номер: {{ profileData.id }}</h1>
|
||||||
|
<h2>{{ profileData.username }}</h2>
|
||||||
|
<p>{{ profileData.email }}</p>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
</style>
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user