From eb2dc534ad2c2ba064933c1185dcbecc8c78135d Mon Sep 17 00:00:00 2001 From: wizardchen Date: Sat, 28 Feb 2026 19:04:41 +0800 Subject: [PATCH] refactor: streamline props and emits definition in doc-content component - Moved the definition of props and emits to a more appropriate location within the doc-content component for better readability and organization. - Removed duplicate prop and emit definitions to enhance code clarity. This update improves the structure of the component, making it easier to maintain and understand. --- frontend/src/components/doc-content.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/doc-content.vue b/frontend/src/components/doc-content.vue index ca4a0a71..15baa2e5 100644 --- a/frontend/src/components/doc-content.vue +++ b/frontend/src/components/doc-content.vue @@ -45,6 +45,8 @@ mermaid.initialize({ topPadding: 50 } }); +const props = defineProps(["visible", "details", "knowledgeType", "sourceInfo"]); +const emit = defineEmits(["closeDoc", "getDoc", "questionDeleted"]); marked.use({ mangle: false, @@ -205,9 +207,6 @@ renderer.code = function (code, infostring) { `; }; -const props = defineProps(["visible", "details", "knowledgeType", "sourceInfo"]); -const emit = defineEmits(["closeDoc", "getDoc", "questionDeleted"]); - // 监听 chunks 变化,自动更新合并内容 watch(() => props.details?.md, (newChunks) => { if (newChunks && newChunks.length > 0) {