Quasar: Expose HTML5 'download' attribute of <a> tags within QBtn API

Created on 20 Dec 2019  ·  3Comments  ·  Source: quasarframework/quasar

Is your feature request related to a problem? Please describe.
I would like to be able to have a button instruct the browser to initiate a download rather than render the linked resource.

Describe the solution you'd like
HTML5 introduced a 'download' attribute for tags. Expose this in the QBtn API to support cases where type="a"

Describe alternatives you've considered
JavaScript-based solutions, or adding query parameters to the URL for the server to instruct it to add a Content-Disposition header to the GET response.

Additional context
None

Most helpful comment

Vue allows you to pass HTML attributes to components. So create a QBtn type=“a” and pass the attribute(s) that you need as if they are props (in your Vue template).

All 3 comments

Have you also tried to add the download attribute to QBtn?

Vue allows you to pass HTML attributes to components. So create a QBtn type=“a” and pass the attribute(s) that you need as if they are props (in your Vue template).

Nice! I didn't realise that. Thanks guys!

Was this page helpful?
0 / 5 - 0 ratings