I just wants to add a link to download a pdf file in nuxt project.
I have tried the following:
<a :href="require('@/static/documents/WTSDL2019_Pamplet.pdf')" download class="btn btn-sm btn-sub-color" >Download</a>
which works well for images but not for pdf files. I found vue-pdf
but I feel its an extra work for the purpose of just linking a pdf file. I have no work view a pdf files with all those events.
I had the same problem, and this worked for me. I added the file to the public
folder (static
in Nuxt 2) and it worked.
static
<a href="/WTSDL2019_Pamplet.pdf" download="">Download</a>