From 8c7338a752c0993fc2d8ec3ad2827c694360e3dd Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 20 Mar 2024 23:06:50 +0800 Subject: [PATCH] :lipstick: Now create post in realm will auto linking --- .../src/components/publish/ArticleEditor.vue | 13 ++++- .../src/components/publish/MomentEditor.vue | 50 +++++++++++-------- .../components/publish/parts/PublishArea.vue | 2 - 3 files changed, 40 insertions(+), 25 deletions(-) diff --git a/pkg/views/src/components/publish/ArticleEditor.vue b/pkg/views/src/components/publish/ArticleEditor.vue index 384eae2..86c993d 100644 --- a/pkg/views/src/components/publish/ArticleEditor.vue +++ b/pkg/views/src/components/publish/ArticleEditor.vue @@ -123,11 +123,12 @@ import { useEditor } from "@/stores/editor" import { getAtk } from "@/stores/userinfo" import { useRealms } from "@/stores/realms"; import { computed, reactive, ref, watch } from "vue"; -import { useRouter } from "vue-router" +import { useRoute, useRouter } from "vue-router" import PlannedPublish from "@/components/publish/parts/PlannedPublish.vue" import Media from "@/components/publish/parts/Media.vue" import PublishArea from "@/components/publish/parts/PublishArea.vue"; +const route = useRoute() const realms = useRealms() const editor = useEditor() @@ -220,6 +221,16 @@ watch(editor.related, (val) => { }) } }) + +watch( + () => route.params.realmId, + (val) => { + if (val) { + data.value.realm_id = parseInt(val as string) + } + }, + { deep: true, immediate: true } +)