我想将样本xlsx文件放入我的公用文件夹(反应项目)中,其他人可以下载此文件。
<Button><link rel="chargeSample" href="%PUBLIC_URL%/chargeSample.xlsx"></link></Button>
我怎样才能做到这一点?
标签定义文档和外部资源之间的链接。要在您的网站上下载功能,您应该更改链接标签
import chargeSample from './public/chargeSample.xlsx'; <Button><a href={chargeSample} download="your file name">Download</a></Button>