PASSAGGIO A VITE !
AGG. 1.1.23
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { tools } from '../../store/Modules/tools'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useI18n } from '@src/boot/i18n'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { defineComponent } from 'vue'
|
||||
@@ -31,17 +31,17 @@ export default defineComponent({
|
||||
// Crea un blob dalla jsonString passata come proprietà
|
||||
const blob = new Blob([props.testoJson], { type: 'application/json' });
|
||||
const url = URL.createObjectURL(blob);
|
||||
|
||||
|
||||
// Crea un link temporaneo
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
const fileName = `${props.nomefile}-${tools.getDateYYYYMMDD_Today()}.json`;
|
||||
link.download = fileName; // Nome del file da scaricare
|
||||
|
||||
|
||||
// Aggiungi il link al DOM e clicca per scaricare
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
||||
|
||||
// Rimuovi il link dal DOM e libera l'oggetto URL
|
||||
document.body.removeChild(link);
|
||||
URL.revokeObjectURL(url);
|
||||
|
||||
Reference in New Issue
Block a user