您的项目上有没有遇到需要在前端显示并比较两个不同版本的文本文件, 希望它像winmerge, 或eclipse的svn比较工具那样标注不同的地方
<html lang="zh"> <head> <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script> <script type="text/javascript" src="../lib/codemirror.min.js"></script> <link type="text/css" rel="stylesheet" href="../lib/codemirror.css" /> <script type="text/javascript" src="../lib/mergely.js"></script> <link type="text/css" rel="stylesheet" href="../lib/mergely.css" /> <script type="text/javascript"> $(document).ready(function() {$('#compare').mergely({ cmsettings : { readOnly : false, lineNumbers : true }, lhs : function(setValue) {setValue('the quick red fox\njumped over the hairy dog');}, rhs : function(setValue) {setValue('the quick brown fox\njumped over the lazy dog');}});}); </script> </head> <body> <div id="compare"></div> </body> </html>
评论