vue-code-diff
vue-code-diff copied to clipboard
feat: 支持自定义比较规则
- 例如
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和比较规则都能动态自定义