wip
This commit is contained in:
parent
0bf007df9e
commit
ec63c3463a
2 changed files with 8 additions and 29 deletions
|
@ -1,27 +0,0 @@
|
|||
<mk-user-page>
|
||||
<mk-ui ref="ui">
|
||||
<mk-user ref="user" user={ parent.user } page={ parent.opts.page }/>
|
||||
</mk-ui>
|
||||
<style lang="stylus" scoped>
|
||||
:scope
|
||||
display block
|
||||
</style>
|
||||
<script lang="typescript">
|
||||
import ui from '../../scripts/ui-event';
|
||||
import Progress from '../../../common/scripts/loading';
|
||||
|
||||
this.user = this.opts.user;
|
||||
|
||||
this.on('mount', () => {
|
||||
document.documentElement.style.background = '#313a42';
|
||||
Progress.start();
|
||||
|
||||
this.$refs.ui.refs.user.on('loaded', user => {
|
||||
Progress.done();
|
||||
document.title = user.name + ' | Misskey';
|
||||
// TODO: ユーザー名をエスケープ
|
||||
ui.trigger('title', '%fa:user%' + user.name);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</mk-user-page>
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<mk-ui :func="fn" func-icon="%fa:pencil-alt%">
|
||||
<span slot="header">%fa:user% {{user.name}}</span>
|
||||
<span slot="header" v-if="!fetching">%fa:user% {{user.name}}</span>
|
||||
<div v-if="!fetching" :class="$style.user">
|
||||
<header>
|
||||
<div class="banner" :style="user.banner_url ? `background-image: url(${user.banner_url}?thumbnail&size=1024)` : ''"></div>
|
||||
|
@ -58,6 +58,7 @@
|
|||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
const age = require('s-age');
|
||||
import Progress from '../../../common/scripts/loading';
|
||||
|
||||
export default Vue.extend({
|
||||
props: {
|
||||
|
@ -81,12 +82,17 @@ export default Vue.extend({
|
|||
}
|
||||
},
|
||||
mounted() {
|
||||
document.documentElement.style.background = '#313a42';
|
||||
Progress.start();
|
||||
|
||||
this.$root.$data.os.api('users/show', {
|
||||
username: this.username
|
||||
}).then(user => {
|
||||
this.fetching = false;
|
||||
this.user = user;
|
||||
this.$emit('loaded', user);
|
||||
|
||||
Progress.done();
|
||||
document.title = user.name + ' | Misskey';
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue