ShowComment
file: code/ShowComment.vue
1: <template>
2: <li class="senph-comment">
3: <div class="senph-comment-from">
4: <span class="senph-comment-username">{{ comment.user_name }}</span>
5: wrote on
6: <span class="senph-comment-created">{{ comment.created }}</span>
7: </div>
8: <VueMarkdown>{{ comment.body }}</VueMarkdown>
9: <AddComment :replyTo="commentUrl(comment)" />
10:
11: <ul class="senph-replies">
12: <ShowComment
13: v-for="reply in comment.comments"
14: :comment="reply"
15: :topicUrl="topicUrl"
16: :key="reply.ident"
17: />
18: </ul>
19: </li>
20: </template>
21:
22: <script>
23: import VueMarkdown from 'vue-markdown'
24: import AddComment from './AddComment.vue';
25:
26: export default {
27: name: 'ShowComment',
28: props: [
29: 'comment', 'topicUrl'
30: ],
31: components: {
32: VueMarkdown, AddComment
33: },
34: methods: {
35: commentUrl(comment){
36: return this.topicUrl + '/' + comment.ident;
37: }
38: }
39: }
40: </script>
41: