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前面的小图标:把小图标作为背景

本文深入探讨ES6的最新特性,包括模块导入导出、箭头函数等,并分享了前端开发中处理下拉框反显、导出文件及input元素样式的实用代码片段。

670

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



