vue-code-diff icon indicating copy to clipboard operation
vue-code-diff copied to clipboard

feat: 支持自定义比较规则

Open lihuacai168 opened this issue 3 years ago • 0 comments

  • 例如
baseJson: {
  "a": 100,
  "b": 100
}

actualJson:
{
  "a": 101,
  "b": 105
}

自定义规则
threshold = 1%
diff = abs((actualJsonValue - baseJsonValue)/baseJsonValue)
当符合 diff > threshold时才认为是diff

上面例子的a就不算diff,b才算diff

符合条件的才认为是不同
支持展示每行的diff
threshold和比较规则都能动态自定义

lihuacai168 avatar Apr 01 '22 10:04 lihuacai168