Prechádzať zdrojové kódy

comment.user.author 为 true 时评论显示删除按钮

reghao 2 rokov pred
rodič
commit
2ed5677b69

+ 1 - 1
src/components/comment/components/CommentItem.vue

@@ -48,7 +48,7 @@
             :datetime="comment.createAt"
           >{{ formatTime(comment.createAt) }}</time>
           <div
-            v-if="user.author === true"
+            v-if="comment.user.author === true"
             class="delete"
             @click.stop="$emit('comment-delete', { id, comment, parent })"
           >

+ 2 - 1
src/components/comment/index.vue

@@ -208,7 +208,8 @@ export default {
         user: {
           userId: -1,
           name: '',
-          avatar: ''
+          avatar: '',
+          author: false
         }
       }
       // 赋值