Shimada666 / v-code-diff

A vue code diff display plugin, support Vue2 / Vue3
https://shimada666.github.io/v-code-diff/
MIT License
407 stars 68 forks source link

feat: add scope for stat slot #119

Closed Lruihao closed 10 months ago

Lruihao commented 10 months ago

usage case

<CodeDiff
  :old-string="form.oldString"
  :new-string="form.newString"
  :language="form.language"
  :diff-style="form.diffStyle"
>
  <template #stat="{ stat }">
    <span class="diff-stat-added">+{{ stat.additionsNum }} 新增</span>
    <span class="diff-stat-deleted">-{{ stat.deletionsNum }} 删除</span>
  </template>
</CodeDiff>
Shimada666 commented 10 months ago

好像不错 待会我试下