F7-button open route. prevent-router not working

I’m using sheetjs and the download file button method opens a not-existing route instead of downloading the file.

	<f7-page name="home">
				<f7-button fill prevent-router>Download</f7-button>
<script setup>
import { ref, onMounted } from 'vue'
import supabase from '../supabase.js'
import {
} from "vue3-xlsx/dist/vue3-xlsx.cjs.prod.js";

const sheet = ref({ name: "SheetOne", data: [{ c: 2 }] });

Same result if I use SheetJs directly without vue wrapper. Also tried f7-button type=“button” and type=“submit”.

Tested with Vue3+Vite default setup and it works fine (with vue router).

Need help, please.


What is the output HTML generated by those xlsx components, it is not the button, i guess it wraps something with <a> tag

Thanks for the reply. This is the HTML generated by components.

<div><!----><div><button class="button button-fill prevent-router" type="submit"><!----><!---->Download XLSX</button></div></div>

Also, I tested this with SheetJS directly without vue wrapper. This is the code I tried but same results. It opens a non-existent route instead of downloading the file.

	<f7-page name="home">
		<f7-button fill prevent-router class="my-3" @click="saveXLSX">Save XLSX</f7-button>
<script setup>
import * as XLSX from "xlsx";

const saveXLSX = async () => {
	const url = "https://sheetjs.com/executive.json";
	const raw_data = await (await fetch(url)).json();

	/* filter for the Presidents */
	const prez = raw_data.filter((row) =>
		row.terms.some((term) => term.type === "prez")

	/* flatten objects */
	const rows = prez.map((row) => ({
		name: row.name.first + " " + row.name.last,
		birthday: row.bio.birthday,

	/* generate worksheet and workbook */
	const worksheet = XLSX.utils.json_to_sheet(rows);
	const workbook = XLSX.utils.book_new();
	XLSX.utils.book_append_sheet(workbook, worksheet, "Dates");

	/* fix headers */
	XLSX.utils.sheet_add_aoa(worksheet, [["Name", "Birthday"]], { origin: "A1" });

	/* calculate column width */
	const max_width = rows.reduce((w, r) => Math.max(w, r.name.length), 10);
	worksheet["!cols"] = [{ wch: max_width }];

	/* create an XLSX file and try to save to Presidents.xlsx */
	XLSX.writeFile(workbook, "Presidents.xlsx");

This demo code from SheetJs.com worked fine with Vue3 + Vite default setup.

The issue is resolved with XLSX.write() method and then save file as blob with capacitor-blob-writer. There is something with XLSX.writeFile() method which is triggering f7 router.