//我在vue中测试, 可行, 这个只适用于google浏览器, ie需要xObject对象 // 下载txt if (/(txt)$/.test(name[1])) { var xhr = new XMLHttpRequest() xhr.onload = function () { ;(function () { var pom = document.createElement('a') pom.setAttribute( 'href', 'data:text/plain;charset=u…