如何使用react返回文件?在express中,这是sendFile。如果文件是exe,那么它将被下载,如果是pdf文件,那么它会显示在浏览器中,如果是图片,那么它也会被显示。我想知道如何使用react实现相同的提要。或者,express可能与react的unload
具有相同的库。这样你就可以跟踪用户何时离开页面
不是最优雅的选项,但很有效。使用<iframe>
使文档全屏显示,指示以下内容:
iframe {
position:fixed;
top:0;
left:0;
bottom:0;
right:0;
width:100%;
height:100%;
border:none;
margin:0;
padding:0;
overflow:hidden;
z-index:999999;
}