current position:Home>React download local template can be downloaded locally, but the deployment online download is blank

React download local template can be downloaded locally, but the deployment online download is blank

2022-04-29 07:00:22CSDN Q & A

The phenomenon and background of the problem

react The template is here pubilc Under the table of contents The download address is as follows

const url = {
downloadUrl: '/public/template/studentTrainingClassTemplate.xlsx',
};

Operation results and error reporting contents

You can download it locally . But you can't download it online

My solution ideas and tried methods
What I want to achieve



Take the answer :

Just write it like this and try
const url = {
downloadUrl: '/template/studentTrainingClassTemplate.xlsx',
};


copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/112/202204221505178863.html

Random recommended