我的项目是react+webpack+redux的结构,jar包是已经有的.我在网上看到用a标签的方法.i.e.点击下载 但是这个方法点击之后都是去访问localhost:9000/assets/sender.txt.
巴扎黑2017-04-17 15:25:57
Add
{
test: /.jar$/,
include: srcPath,
loader: 'file-loader?name=jar/[name].[ext]'
}
Introduce the jar package into src/component/caseList/CaseOperations.jsx where the a tag is located. My jar package is placed under src, so import { caseSender } from '../../case-sender.jar' ,<a href={caseSender} download>Export</a>