Skip to content

Commit 2f43b6b

Browse files
committed
fix: only highlight after mount
1 parent fd6da5e commit 2f43b6b

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

app/components/diff/Line.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,14 @@ async function highlightSegments() {
109109
})
110110
}
111111
112+
const mounted = useMounted()
113+
112114
watch(
113-
() => [props.line, diffContext?.language?.value, colorMode.value],
115+
() => [mounted.value, props.line, diffContext?.language?.value, colorMode.value],
114116
() => {
115-
highlightSegments()
117+
if (mounted.value) highlightSegments()
116118
},
117-
{ immediate: true, deep: true },
119+
{ deep: true },
118120
)
119121
</script>
120122

0 commit comments

Comments
 (0)