fix: file upload key loss #120

This commit is contained in:
vben
2020-12-08 22:18:20 +08:00
parent bae53f3e2c
commit 29461a8568
14 changed files with 29 additions and 12 deletions

View File

@@ -31,6 +31,7 @@ export function jsonToSheetXlsx<T = any>({
writeFile(workbook, filename, write2excelOpts);
/* at this point, out.xlsb will have been downloaded */
}
export function aoaToSheetXlsx<T = any>({
data,
header,

View File

@@ -17,7 +17,7 @@
import type { ExcelData } from './types';
export default defineComponent({
name: 'ImportExcel',
emits: ['success'],
emits: ['success', 'error'],
setup(_, { emit }) {
const inputRef = ref<HTMLInputElement | null>(null);
const loadingRef = ref<Boolean>(false);
@@ -82,6 +82,7 @@
resolve('');
} catch (error) {
reject(error);
emit('error');
} finally {
loadingRef.value = false;
}

View File

@@ -17,6 +17,7 @@ export interface JsonToSheet<T = any> {
json2sheetOpts?: JSON2SheetOpts;
write2excelOpts?: WritingOptions;
}
export interface AoAToSheet<T = any> {
data: T[][];
header?: T[];