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:
@@ -45,6 +45,8 @@ mermaid.initialize({
|
|||||||
topPadding: 50
|
topPadding: 50
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
const props = defineProps(["visible", "details", "knowledgeType", "sourceInfo"]);
|
||||||
|
const emit = defineEmits(["closeDoc", "getDoc", "questionDeleted"]);
|
||||||
|
|
||||||
marked.use({
|
marked.use({
|
||||||
mangle: false,
|
mangle: false,
|
||||||
@@ -205,9 +207,6 @@ renderer.code = function (code, infostring) {
|
|||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
};
|
};
|
||||||
const props = defineProps(["visible", "details", "knowledgeType", "sourceInfo"]);
|
|
||||||
const emit = defineEmits(["closeDoc", "getDoc", "questionDeleted"]);
|
|
||||||
|
|
||||||
// 监听 chunks 变化,自动更新合并内容
|
// 监听 chunks 变化,自动更新合并内容
|
||||||
watch(() => props.details?.md, (newChunks) => {
|
watch(() => props.details?.md, (newChunks) => {
|
||||||
if (newChunks && newChunks.length > 0) {
|
if (newChunks && newChunks.length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user