diff --git a/frontend/src/components/doc-content.vue b/frontend/src/components/doc-content.vue index fa836a48..6f659607 100644 --- a/frontend/src/components/doc-content.vue +++ b/frontend/src/components/doc-content.vue @@ -690,6 +690,24 @@ const getParentContent = (item: any) => { return parentContextCache.value.get(item.parent_chunk_id) || ''; }; +const summaryExpanded = ref(false); +const summaryRef = ref(); +const summaryOverflow = ref(false); + +const checkSummaryOverflow = () => { + nextTick(() => { + const el = summaryRef.value; + if (!el) { summaryOverflow.value = false; return; } + summaryOverflow.value = el.scrollHeight > el.clientHeight + 1; + }); +}; + +watch(() => props.details?.description, () => { + summaryExpanded.value = false; + checkSummaryOverflow(); +}); +watch(summaryRef, () => checkSummaryOverflow()); + const downloadFile = () => { downKnowledgeDetails(props.details.id) .then((result) => { @@ -734,7 +752,7 @@ const handleDetailsScroll = () => {