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 } +)