Appearance
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
@@ -1,3 +1,3 @@ keepold linenew 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
| Name | Type | Default | Description |
|---|---|---|---|
id | string | ||
class | string | ||
diff | string | '' | A unified diff, as printed by git diff. |
view | string | 'unified' | |
lineNumbers | boolean | true | |
title | string |
See Theming for the class hooks and the data-* state of the components.