v-code-diff
v-code-diff copied to clipboard
A vue code diff display plugin, support Vue2 / Vue3
使用时直接报错
提示 diff2html 没有 diff.js 文件,去目录看了一下确实没有,应该是 diff2html 版本更改造成的? 希望修复一下。
参考Highlight.js主页的用法: https://github.com/highlightjs/highlight.js ``` const hljs = require('highlight.js/lib/core'); hljs.registerLanguage('xml', require('highlight.js/lib/languages/xml')); const highlightedCode = hljs.highlight('Hello World!', {language: 'xml'}).value ``` 我实在是不需要语言高亮。将`import hljs from 'highlight.js'`替换为`import * as hljs from 'highlight.js/lib/core'`之后,js文件从1M减小到了100K。 另外Highlight.js官方有一个vue plugin: https://github.com/highlightjs/vue-plugin
In the 0.x version, the html is created by the diff2html plugin to create an html string and then mounted on the element. Although this is simple, it is difficult...
https://github.com/ddchef/vue-code-diff/issues/60 先渲染空值了,然后再去赋值相同值,就会出现这个问题

 大佬,诉求如截图所示这样的,目前在实际应用中需要手动hack来处理隐藏。 _Originally posted by @xiang0308 in https://github.com/Shimada666/v-code-diff/issues/15#issuecomment-1210450899_