]> git.r.bdr.sh - rbdr/dasein/blobdiff - app/components/post.js
Add Comments (#4)
[rbdr/dasein] / app / components / post.js
diff --git a/app/components/post.js b/app/components/post.js
new file mode 100644 (file)
index 0000000..bb72189
--- /dev/null
@@ -0,0 +1,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
+  }
+});