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.
This commit is contained in:
wizardchen
2026-02-28 19:04:41 +08:00
committed by lyingbug
parent 4a9977b11f
commit eb2dc534ad
+2 -3
View File
@@ -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) {
</div>
`;
};
const props = defineProps(["visible", "details", "knowledgeType", "sourceInfo"]);
const emit = defineEmits(["closeDoc", "getDoc", "questionDeleted"]);
// 监听 chunks 变化,自动更新合并内容
watch(() => props.details?.md, (newChunks) => {
if (newChunks && newChunks.length > 0) {