From 36afe6ce3f4e913b7a03437b99cb59d1f557f1d6 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 20 Mar 2024 23:20:00 +0800 Subject: [PATCH] :bug: Fix UI bugs --- pkg/views/src/components/comments/CommentList.vue | 2 +- pkg/views/src/components/posts/PostAction.vue | 4 ++-- pkg/views/src/components/publish/ArticleEditor.vue | 1 - pkg/views/src/components/publish/MomentEditor.vue | 1 - 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/views/src/components/comments/CommentList.vue b/pkg/views/src/components/comments/CommentList.vue index 2a36bcf..d40c9d1 100644 --- a/pkg/views/src/components/comments/CommentList.vue +++ b/pkg/views/src/components/comments/CommentList.vue @@ -75,7 +75,7 @@ watch(editor, (val) => { }) function leaveComment() { - editor.related.comment_to = props.item + editor.related.comment_to = JSON.parse(JSON.stringify(props.item)) editor.related.comment_to.model_type = props.dataset editor.show.comment = true } diff --git a/pkg/views/src/components/posts/PostAction.vue b/pkg/views/src/components/posts/PostAction.vue index 6cc2759..3299a01 100644 --- a/pkg/views/src/components/posts/PostAction.vue +++ b/pkg/views/src/components/posts/PostAction.vue @@ -25,13 +25,13 @@ const props = defineProps<{ item: any }>() const isOwned = computed(() => props.item?.author_id === id.userinfo.data.id) function editPost() { - editor.related.edit_to = props.item + editor.related.edit_to = JSON.parse(JSON.stringify(props.item)) if (editor.show.hasOwnProperty(props.item.model_type)) { // @ts-ignore editor.show[props.item.model_type] = true } if (props.item.model_type === "comment") { - editor.related.comment_to = props.item + editor.related.comment_to = JSON.parse(JSON.stringify(props.item)) } } diff --git a/pkg/views/src/components/publish/ArticleEditor.vue b/pkg/views/src/components/publish/ArticleEditor.vue index 86c993d..5fc876c 100644 --- a/pkg/views/src/components/publish/ArticleEditor.vue +++ b/pkg/views/src/components/publish/ArticleEditor.vue @@ -209,7 +209,6 @@ function pasteMedia(evt: ClipboardEvent) { } }) }) - evt.preventDefault() } } diff --git a/pkg/views/src/components/publish/MomentEditor.vue b/pkg/views/src/components/publish/MomentEditor.vue index d3a3d5f..9ac21bf 100644 --- a/pkg/views/src/components/publish/MomentEditor.vue +++ b/pkg/views/src/components/publish/MomentEditor.vue @@ -154,7 +154,6 @@ function pasteMedia(evt: ClipboardEvent) { Array.from(files).forEach((item) => { media.value.upload(item) }) - evt.preventDefault() } }