@hakulex/diff
v0.4.1
Published
Show what changed between two hakulex documents, side by side or in one column
Maintainers
Readme
@hakulex/diff
並排或單欄顯示兩個版本文件的差異。
hakulex 的一部分:給 Vue 3 的富文本編輯器,建立在 Lexical 上。這個套件的說明和可以操作的範例在 hakulex.dev/packages/diff。
安裝
pnpm add @hakulex/diff lexical vue樣式
套件的程式不會自己載入樣式。在應用程式的進入點引入一次,另外也要引入文件內容的樣式 @hakulex/style-token/style.css。
import '@hakulex/diff/style.css'使用
範例裡的 ./documents 是你自己的文件 JSON,也就是編輯器的 v-model 存下來的內容。
<script setup lang="ts">
import { RichDiff } from '@hakulex/diff'
import { article, revised } from './documents'
</script>
<template>
<RichDiff :old-value="article" :new-value="revised" layout="inline" />
</template>