工作中遇到需要在浏览器上直接预览.log,.conf这样的文件。
const fn = (url: string)=> {
const res = await request(url);
const win = window.open("", '_blank');
win.document.write(`<pre>${res}</pre>`)
win.document.close()
}
微信扫一扫
工作中遇到需要在浏览器上直接预览.log,.conf这样的文件。
const fn = (url: string)=> {
const res = await request(url);
const win = window.open("", '_blank');
win.document.write(`<pre>${res}</pre>`)
win.document.close()
}
相关推荐