首先需要下载codemirror组件,diff-match-patch组件
npm install codemirror
npm install diff-match-patch
当然啦,npm下载很是缓慢,换个国内镜像,淘宝的吧。果然,速度就嗖嗖的起来。
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install
cnpm install codemirror
cnpm install diff-match-patch
可在node_modules下看到其目录结构

核心代码如下,简练易懂,可以根据下面的自己在接着定制开发。
<template>
<div>
<!-- 操作按钮 -->
<el-button @click="handleAdd">代码编辑,高亮补全</el-button>
<el-button @click="handleMerge">代码版本,差异对比</el-button>
<!-- 代码编辑,高亮补全 对话框内容 -->
<el-dialog :title="title" :visible.sync="open">
订阅专栏 解锁全文
8469

被折叠的 条评论
为什么被折叠?



