//保存文件
saveData:function(){
var that = this
var name = that.fileleftname
let difffile = that.difffile
difffile = difffile.replace(/\"/g,"")
difffile = difffile.replace(/</g,that.fileleftname1+" ")
difffile = difffile.replace(/>/g,that.filerightname1+" ")
difffile = difffile.replace(/---/g,"----------------------------------------------------------------------------------------------------------------------------------------------------------")
console.log(difffile)
// 建立a标签
var elementA = document.createElement(‘a’);
//文件的称号为时候戳加文件名后缀
elementA.download = name+“文件差异” + “.txt”;
elementA.style.display = ‘none’;
//天生一个blob二进制数据,内容为json数据
var blob = new Blob([difffile], {type: “text/plain;charset=utf-8”});
console.log(URL.createObjectURL(blob))
//天生一个指向blob的URL地点,并赋值给a标签的href属性
elementA.href = URL.createObjectURL(blob);
document.body.appendChild(elementA);
elementA.click();
document.body.removeChild(elementA);
}