Within my Nuxt project, I have implemented a feature that allows users to download PDF files. When a user clicks on the provided link, they are redirected to a new page. In this new page, I need to extract URL queries (information) and send them to the store to retrieve state information. Once I obtain the state information, I display it on the current page.
http://localhost:3000/printPdf?pdfId=690a9567-4c36-41c0-893c-587be307df25&number=1153379003428
This is the link that triggers the process. Upon clicking it, I collect the print ID and number in the store to return a state needed for generating the PDF. I have utilized both created and asyncData methods for this functionality.
asyncData({app, params, route, store}) {
const url = route.query
store.dispatch('POST_PDF_PRINT', url)
}