File tree Expand file tree Collapse file tree
web/src/components/advanced Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -397,13 +397,17 @@ const commentAnchorId = (id: string) => `comment-anchor-${id}`
397397const highlightedId = ref <string | null >(null )
398398let highlightTimer: ReturnType <typeof setTimeout > | null = null
399399
400- const jumpToComment = (id ? : string | null ) => {
400+ const jumpToComment = async (id ? : string | null ) => {
401401 if (! id ) return
402402 const el = document .getElementById (commentAnchorId (id ))
403403 if (! el ) return
404404 el .scrollIntoView ({ behavior: ' smooth' , block: ' center' })
405- highlightedId .value = id
406405 if (highlightTimer ) clearTimeout (highlightTimer )
406+ // 先清空并等 DOM 落地,再赋值,强制 CSS 高亮动画重播——
407+ // 否则连续点同一目标时 highlightedId 值未变,Vue 不重渲染,动画不会重新触发。
408+ highlightedId .value = null
409+ await nextTick ()
410+ highlightedId .value = id
407411 highlightTimer = setTimeout (() => {
408412 highlightedId .value = null
409413 highlightTimer = null
You can’t perform that action at this time.
0 commit comments