How does vue convert the current page to html and download it?

I now have a resume page. The front end uses vuejs+vue-router+vuex, but I don"t know how to convert the page of the current path into html and download it. Do you know?

clipboard.png

Mar.22,2021

right, save as html


your requirement should be to save the current web page in pdf format and download it. If so, please refer to this article


.

this requirement of yours, I will disassemble it into two parts to implement.

the first step is to get the source code for the current web page.

this is relatively simple, directly

fetch(url).then(res => console.log(`res`))

the second problem is how to implement the front-end download.

I happen to have done something similar. The principle is to simulate the operation that the user clicks to download.

if you are a hand-holding party, you can use the library I wrote: https://github.com/azl3979858.

.

I hope my answer will be helpful to you. My personal homepage is https://azl397985856.github.io/, and the Nuggets homepage https://juejin.im/user/58af98.

Menu