vue-jsdiff
中文 | English
A javascript text differencing implementation for Vue.
Vue-jsdiff does not provide UI, is an encapsulation of jsdiff. Its API is the same as jsdiff ver. 5.0.0.
Installation
npm install vue-jsdiff --save
Examples
import Diff from 'vue-jsdiff'
export default {
name: 'example',
created () {
console.log(Diff.diffLines('old string', 'new string'))
}
}
API list
See jsdiff for detailed documents.
- diffChars
- diffWords
- diffWordsWithSpace
- diffLines
- diffTrimmedLines
- diffSentences
- diffCss
- diffJson
- diffArrays
- structuredPatch
- createTwoFilesPatch
- createPatch
- applyPatch
- applyPatches
- parsePatch
- merge
- convertChangesToDMP
- convertChangesToXML
- canonicalize
Other
Vue-jsdiff has no plan for constant maitaining.
License
Using BSD License