我在我正在撰寫的應用程式中包含一個關于頁面。該頁面應包含一個鏈接,單擊該鏈接可下載 PDF 檔案。這是about.component.html檔案:
<h1>About</h1>
<div class="panel">
<p>
Here is the first panel text.
</p>
<p>
Here is the second panel text.
</p>
</div>
<a ng-href="PDFFile.pdf" href="PDFFile.pdf">Download Information Sheet</a>
鏈接出現了,但是當我點擊它時,什么也沒有出現。 PDFFile.pdf與about.component.html位于同一目錄中。我在這里錯過了什么嗎?
uj5u.com熱心網友回復:
將 pdf 檔案移動到資產檔案夾并將鏈接更改為“/assets/PDFFile.pdf”。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/400350.html
下一篇:錯誤TS2362:算術運算的左側必須是“any”、“number”、“bigint”型別(在字串插值{{}}內)
