You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.2 KiB
58 lines
1.2 KiB
|
4 years ago
|
<template>
|
||
|
|
<div class="row q-col-gutter-md">
|
||
|
|
<div class="col-8">
|
||
|
4 years ago
|
<SocialNetworkWall />
|
||
|
4 years ago
|
</div>
|
||
|
|
<div class="col-4">
|
||
|
4 years ago
|
<q-card bordered flat>
|
||
|
4 years ago
|
<img
|
||
|
|
:src="user.illustrationUrl"
|
||
|
|
/>
|
||
|
|
|
||
|
|
<q-card-section class="text-center">
|
||
|
|
<div class="text-h6">{{ user.fullName }}</div>
|
||
|
|
<div class="text-subtitle2">{{ user.username }}</div>
|
||
|
|
</q-card-section>
|
||
|
|
</q-card>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
import {useStore} from "vuex";
|
||
|
4 years ago
|
import {onMounted, provide, readonly, ref, watch} from "vue";
|
||
|
2 years ago
|
import SocialNetworkWall from "./SocialWall.vue";
|
||
|
4 years ago
|
import {useRoute} from "vue-router";
|
||
|
4 years ago
|
|
||
|
|
export default {
|
||
|
|
name: "SocialNetworkLayout",
|
||
|
4 years ago
|
components: {SocialNetworkWall},
|
||
|
4 years ago
|
setup() {
|
||
|
4 years ago
|
const store = useStore();
|
||
|
4 years ago
|
const route = useRoute();
|
||
|
4 years ago
|
|
||
|
|
const user = ref({});
|
||
|
|
|
||
|
4 years ago
|
provide('social-user', readonly(user));
|
||
|
4 years ago
|
|
||
|
4 years ago
|
async function loadUser() {
|
||
|
|
try {
|
||
|
|
user.value = route.query.id
|
||
|
|
? await store.dispatch('user/load', route.query.id)
|
||
|
|
: store.getters['security/getUser'];
|
||
|
|
} catch (e) {
|
||
|
|
user.value = {};
|
||
|
4 years ago
|
}
|
||
|
|
}
|
||
|
|
|
||
|
4 years ago
|
onMounted(loadUser);
|
||
|
4 years ago
|
|
||
|
4 years ago
|
watch(() => route.query, loadUser);
|
||
|
4 years ago
|
|
||
|
|
return {
|
||
|
|
user
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</script>
|