es6
1、这篇文章介绍es6新特性:https://www.jianshu.com/p/87008f4f8513
2、下拉框反显时有时候会异常,用this.$set(表单,“字段”, 值);
3、导出文件:
exportRight() {
var xhr = new XMLHttpRequest();
// 添加请求的方式,地址
xhr.open(“GET”, $api.rights.downloadLatino+’?mcid=’+this.selection[0].mcid, true);
// 设置responseType
xhr.responseType = “blob”;
xhr.onload = function(e) {
var content = xhr.response;
// 组装a标签
// let timestamp = frs.getLocalTime(new Date());
var elink = document.createElement(“a”);
// 设置下载文件名
elink.download = “免费权益导出文件” + “.xlsx”;
elink.style.display = “none”;
let blob = new Blob([content]);
elink.href = URL.createObjectURL(blob);
document.body.appendChild(elink);
// 模拟点击事件
elink.click();
document.body.removeChild(elink);
};
xhr.send();
},
4、input前面的小图标:把小图标作为背景