This commit is contained in:
syuilo 2018-04-08 19:30:19 +09:00
parent 2076ab876a
commit ba280ac380
1 changed files with 7 additions and 11 deletions

View File

@ -2,12 +2,12 @@
<div class="mk-user-preview"> <div class="mk-user-preview">
<template v-if="u != null"> <template v-if="u != null">
<div class="banner" :style="u.bannerUrl ? `background-image: url(${u.bannerUrl}?thumbnail&size=512)` : ''"></div> <div class="banner" :style="u.bannerUrl ? `background-image: url(${u.bannerUrl}?thumbnail&size=512)` : ''"></div>
<router-link class="avatar" :to="`/@${acct}`"> <router-link class="avatar" :to="`/@${getAcct(u)}`">
<img :src="`${u.avatarUrl}?thumbnail&size=64`" alt="avatar"/> <img :src="`${u.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link> </router-link>
<div class="title"> <div class="title">
<router-link class="name" :to="`/@${acct}`">{{ u.name }}</router-link> <router-link class="name" :to="`/@${getAcct(u)}`">{{ u.name }}</router-link>
<p class="username">@{{ acct }}</p> <p class="username">@{{ getAcct(u) }}</p>
</div> </div>
<div class="description">{{ u.description }}</div> <div class="description">{{ u.description }}</div>
<div class="status"> <div class="status">
@ -39,14 +39,10 @@ export default Vue.extend({
required: true required: true
} }
}, },
computed: {
acct() {
return getAcct(this.u);
}
},
data() { data() {
return { return {
u: null u: null,
getAcct
}; };
}, },
mounted() { mounted() {
@ -57,8 +53,8 @@ export default Vue.extend({
}); });
} else { } else {
const query = this.user[0] == '@' ? const query = this.user[0] == '@' ?
parseAcct(this.user[0].substr(1)) : parseAcct(this.user.substr(1)) :
{ userId: this.user[0] }; { userId: this.user };
(this as any).api('users/show', query).then(user => { (this as any).api('users/show', query).then(user => {
this.u = user; this.u = user;