wip
This commit is contained in:
parent
7a97924d01
commit
463a38d606
|
@ -6,6 +6,8 @@ import timeline from './timeline.vue';
|
||||||
import posts from './posts.vue';
|
import posts from './posts.vue';
|
||||||
import imagesImage from './images-image.vue';
|
import imagesImage from './images-image.vue';
|
||||||
import drive from './drive.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-ui', ui);
|
||||||
Vue.component('mk-home', home);
|
Vue.component('mk-home', home);
|
||||||
|
@ -13,3 +15,5 @@ Vue.component('mk-timeline', timeline);
|
||||||
Vue.component('mk-posts', posts);
|
Vue.component('mk-posts', posts);
|
||||||
Vue.component('mk-images-image', imagesImage);
|
Vue.component('mk-images-image', imagesImage);
|
||||||
Vue.component('mk-drive', drive);
|
Vue.component('mk-drive', drive);
|
||||||
|
Vue.component('mk-post-preview', postPreview);
|
||||||
|
Vue.component('mk-sub-post-content', subPostContent);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<mk-ui :func="fn">
|
<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>
|
<template slot="funcIcon">%fa:pencil-alt%</template>
|
||||||
<div v-if="!fetching" :class="$style.user">
|
<div v-if="!fetching" :class="$style.user">
|
||||||
<header>
|
<header>
|
||||||
|
@ -58,15 +58,11 @@
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
const age = require('s-age');
|
import age from 's-age';
|
||||||
import Progress from '../../../common/scripts/loading';
|
import Progress from '../../../common/scripts/loading';
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
props: {
|
props: {
|
||||||
username: {
|
|
||||||
type: String,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
page: {
|
page: {
|
||||||
default: 'home'
|
default: 'home'
|
||||||
}
|
}
|
||||||
|
@ -82,12 +78,22 @@ export default Vue.extend({
|
||||||
return age(this.user.profile.birthday);
|
return age(this.user.profile.birthday);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
this.fetch();
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
$route: 'fetch'
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
document.documentElement.style.background = '#313a42';
|
document.documentElement.style.background = '#313a42';
|
||||||
|
(this as any).api('users/show', {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fetch() {
|
||||||
Progress.start();
|
Progress.start();
|
||||||
|
|
||||||
(this as any).api('users/show', {
|
(this as any).api('users/show', {
|
||||||
username: this.username
|
username: this.$route.params.user
|
||||||
}).then(user => {
|
}).then(user => {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.fetching = false;
|
this.fetching = false;
|
||||||
|
@ -96,6 +102,7 @@ export default Vue.extend({
|
||||||
document.title = user.name + ' | Misskey';
|
document.title = user.name + ' | Misskey';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue