Use vue-pdf to preview pdf files

For local preview, if it is used cli/3, you need to put the pdf file publicunder the file, create a new staticfolder, and put it in it

use

Installing vue-pdf
can only use absolute paths, and /means publicfolders, so it needs to be ignored, as follows

import pdf from "vue-pdf"

components:{
    
    
	pdf 
}

<pdf src="/static/aaa.pdf"></pdf>  

If it is remote, it is url


Some use pdf.js plug-ins and the like, and in the end it is also your online address, https:xxxx/xxx.com/xxx.pdf + other processing, address

Guess you like

Origin blog.csdn.net/sxs7970/article/details/119675514