Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create on download #6

Open
Worthaboutapig opened this issue Oct 14, 2019 · 1 comment
Open

Create on download #6

Worthaboutapig opened this issue Oct 14, 2019 · 1 comment

Comments

@Worthaboutapig
Copy link

I may be missing something here, but it seems, as the download component is a child of the other components, a workbook with sheets is created regardless. How to I create the workbook with sheets on demand? i.e. I don't want to create the workbook until it's requested by the download click?

@DonNicoJs
Copy link
Owner

@Worthaboutapig True, the default use case is to have the workbook live with the data, if you do not want this behaviour, currently it's a bit of a hack, but it's a good idea to implement this, I will think of an efficient way to do so.

if you want to create the workbook only when download is pressed:

  • put xlsx-workbook under v-if and add a ref to it like xlsx
  • on xlsx-workbook add a listener for change with a function that will 'click' xlsxl-download button ( with the ref )
  • inside xlsx-workbook add xlsx-download with a ref
  • have a download button that set the v-if to true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants