1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-20 09:38:19 +09:00
cherrypick/src/client/app/desktop/views/widgets/channel.channel.note.vue

66 lines
1.2 KiB
Vue
Raw Normal View History

2018-02-21 15:30:03 +09:00
<template>
2018-04-08 02:30:37 +09:00
<div class="note">
2018-02-21 15:30:03 +09:00
<header>
2018-04-08 02:30:37 +09:00
<a class="index" @click="reply">{{ note.index }}:</a>
2018-04-09 18:52:29 +09:00
<router-link class="name" :to="note.user | userPage" v-user-preview="note.user.id"><b>{{ note.user | userName }}</b></router-link>
<span>ID:<i>{{ note.user | acct }}</i></span>
2018-02-21 15:30:03 +09:00
</header>
<div>
2018-04-08 02:30:37 +09:00
<a v-if="note.reply">&gt;&gt;{{ note.reply.index }}</a>
{{ note.text }}
<div class="media" v-if="note.media">
<a v-for="file in note.media" :href="file.url" target="_blank">
2018-02-21 15:30:03 +09:00
<img :src="`${file.url}?thumbnail&size=512`" :alt="file.name" :title="file.name"/>
</a>
</div>
</div>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
2018-03-27 16:51:12 +09:00
2018-02-21 15:30:03 +09:00
export default Vue.extend({
2018-04-08 02:30:37 +09:00
props: ['note'],
2018-02-21 15:30:03 +09:00
methods: {
reply() {
2018-04-08 02:30:37 +09:00
this.$emit('reply', this.note);
2018-02-21 15:30:03 +09:00
}
}
});
</script>
<style lang="stylus" scoped>
2018-04-08 02:30:37 +09:00
.note
2018-02-21 15:30:03 +09:00
margin 0
padding 0
color #444
> header
position -webkit-sticky
position sticky
z-index 1
top 0
padding 8px 4px 4px 16px
background rgba(255, 255, 255, 0.9)
> .index
margin-right 0.25em
> .name
margin-right 0.5em
color #008000
> div
padding 0 16px 16px 16px
> .media
> a
display inline-block
> img
max-width 100%
vertical-align bottom
</style>