前端window.open实现导出携带参数

如何使用window.open导出并携带参数

首先这个方法很好用

      window.open(`/api/project-manager/projectReport/exportTimeStatistics?projectId=${this.projectId}&startTime=${this.startTime}&endTime=${this.endTime}`)

直接写路径,可以直接打开,如果需要带参数的话,可以像我一样,记得使用es6
的插值表达式,tab建上面的那个小引号··用来携带参数

?projectId=${this.projectId}&startTime=${this.startTime}&endTime=${this.endTime}

猜你喜欢

转载自blog.csdn.net/xybhua/article/details/129354317