Skip to content

ContentDiff ​

A diff in unified or split view, with ins and del elements.

ts
import { ContentDiff } from '@zairakai/vue-components/Content'

Usage ​

vue
<ContentDiff />

Example ​

a.txt
@@ -1,3 +1,3 @@
keep
old line
new line
end
vue
<script setup>
  const diff = `@@ -1,3 +1,3 @@
 keep
-old line
+new line
 end`
</script>

<template>
  <ContentDiff
    :diff="diff"
    title="a.txt"
  />
</template>

Props ​

NameTypeDefaultDescription
idstring
classstring
diffstring''A unified diff, as printed by git diff.
viewstring'unified'
lineNumbersbooleantrue
titlestring

See Theming for the class hooks and the data-* state of the components.

Documentation of 1.4.4 , built from 8e9b054 on 1.4.4 by pipeline #2989941079 on 2026-10-26.