Skip to content
Snippets Groups Projects
Commit 463a38d6 authored by syuilo's avatar syuilo
Browse files

wip

parent 7a97924d
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,8 @@ import timeline from './timeline.vue';
import posts from './posts.vue';
import imagesImage from './images-image.vue';
import drive from './drive.vue';
import postPreview from './post-preview.vue';
import subPostContent from './sub-post-content.vue';
Vue.component('mk-ui', ui);
Vue.component('mk-home', home);
......@@ -13,3 +15,5 @@ Vue.component('mk-timeline', timeline);
Vue.component('mk-posts', posts);
Vue.component('mk-images-image', imagesImage);
Vue.component('mk-drive', drive);
Vue.component('mk-post-preview', postPreview);
Vue.component('mk-sub-post-content', subPostContent);
<template>
<mk-ui :func="fn">
<span slot="header" v-if="!fetching">%fa:user% {{user.name}}</span>
<span slot="header" v-if="!fetching">%fa:user% {{ user.name }}</span>
<template slot="funcIcon">%fa:pencil-alt%</template>
<div v-if="!fetching" :class="$style.user">
<header>
......@@ -58,15 +58,11 @@
<script lang="ts">
import Vue from 'vue';
const age = require('s-age');
import age from 's-age';
import Progress from '../../../common/scripts/loading';
export default Vue.extend({
props: {
username: {
type: String,
required: true
},
page: {
default: 'home'
}
......@@ -82,19 +78,30 @@ export default Vue.extend({
return age(this.user.profile.birthday);
}
},
created() {
this.fetch();
},
watch: {
$route: 'fetch'
},
mounted() {
document.documentElement.style.background = '#313a42';
Progress.start();
(this as any).api('users/show', {
username: this.username
}).then(user => {
this.user = user;
this.fetching = false;
Progress.done();
document.title = user.name + ' | Misskey';
});
},
methods: {
fetch() {
Progress.start();
(this as any).api('users/show', {
username: this.$route.params.user
}).then(user => {
this.user = user;
this.fetching = false;
Progress.done();
document.title = user.name + ' | Misskey';
});
}
}
});
</script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment