jsondiffpatch for react简单封装
npm install jsondiffpatch-for-react
import React from 'react';
import JsonDiffReact from 'jsondiffpatch-for-react';
<JsonDiffReact
right: PropTypes.any,
left: PropTypes.any,
show: PropTypes.bool,
annotated: PropTypes.bool,
tips: PropTypes.string,
/>
-
left
(array, object, string) -
right
(array, object, string) -
show
(bool)you can show/hide unchanged values
-
annotated
(bool)This will render the original JSON delta in html, with annotations aside explaining the meaning of each part. This attempts to make the JSON delta format self-explained.