aboutsummaryrefslogtreecommitdiff
path: root/app/components/post.js
blob: bb72189f8121b1cf5ebe49b77e4ac786b5e7fd10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import Vue from 'vue';

import CommentsComponent from './comments';

const internals = {};

export default internals.PostComponent = Vue.component('post', {
  template: '<article class="post">' +
      '<aside class="post-meta">' +
      '<img :src="post.userImage" v-bind:alt="\'Avatar for @\' + post.userId">' +
      '<a v-bind:href="\'https://twitter.com/\' + post.userId">{{post.userName}}</a> said on ' +
      '<time v-bind:datetime="post.timestamp | datetime">{{post.timestamp | usertime}}</time>' +
      '</aside>' +
      '<div class="post-content">{{post.content}}</div>' +
      '<comments v-bind:postUuid="post.uuid"></post>' +
      '</article>',

  props: ['post'],

  components: {
    comments: CommentsComponent
  }
});