/* get state data and export to XLSX */ functionexportFile() { /* generate worksheet from state */ const ws = utils.json_to_sheet(pres.value); /* create workbook and append worksheet */ const wb = utils.book_new(); utils.book_append_sheet(wb, ws, "Data"); /* export to XLSX */ writeFileXLSX(wb, "SheetJSVueAoO.xlsx"); } </script>
Replace src/App.vue with the src/SheetJSVueAoO.vue example.
The page will refresh and show a table with an Export button. Click the button and the page will attempt to download SheetJSVueAoA.xlsx. There may be a delay > > since Vite will try to optimize the SheetJS library on the fly. 5) Build the site:
1
npm run build
The generated site will be placed in the dist folder.
Start a local web server:
1
npx http-server dist
Access the displayed URL (typically http://localhost:8080) with a web browser and test the page.