Commit 94341282 by lijiabin

【线上优化】 fix: 修复问吧详情【展开全部/收起】的bug

parent 6f582a53
......@@ -451,20 +451,17 @@ const questionContentRef = useTemplateRef<HTMLElement>('questionContentRef')
const isExpand = ref(false)
// 检测当前是否超过三行 要用到具体的dom
const isOverThreeLine = ref(false)
const checkIsOverThreeLine = () => {
const isOverThreeLine = computed(() => {
if (!questionContentRef.value || !questionDetail.value.content) return false
const lineHeight = parseFloat(getComputedStyle(questionContentRef.value).lineHeight)
const height = questionContentRef.value!.scrollHeight
const maxHeight = lineHeight * 3
return height > maxHeight
}
})
const getQuestionDetail = async () => {
const { data } = await getArticleDetail(questionId)
questionDetail.value = data
await nextTick()
isOverThreeLine.value = checkIsOverThreeLine()
}
const { list, total, searchParams, goToPage, refresh } = usePageSearch(getCommentList, {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment