vue.js - Image route that is dynamically generated, not html content type - Stack Overflow

admin2025-04-17  3

I have a Vue3 SPA that generates dashbaords and such. When I visit / it loads my app. I want to visit and have the response be a image/png media type with image data.

I want to create a route like this:

{ path: '/dynamic-img', component: () => import('components/DrawChart'), name: 'DrawChart' },

And when that component renders, it returns an image/png media type to client, that is the image.

Can this be done using vuejs? I understand there are ways to handle web page scraping to gather the images, but I'd like to do it directly from vue.

转载请注明原文地址:http://anycun.com/QandA/1744851961a88518.html