Browse Source

feat: add custom event excel-data-change

Hugh Harlequin 1 year ago
parent
commit
bea6358d25
3 changed files with 4 additions and 0 deletions
  1. 3 0
      index.html
  2. 0 0
      js/dist/excel-preview.min.js
  3. 1 0
      js/src/excel-preview.js

+ 3 - 0
index.html

@@ -46,6 +46,9 @@
 			"allowedFileExtensions":["xlsx","xls"],
 			"browseOnZoneClick":true,
 			"msgPlaceholder":"選擇檔案 - msgPlaceholder"});
+	 	$('[name=file]').on('excel-data-change', function () {
+	 		console.log($(this).data('excel-data'));
+		})
 	</script>
 </body>
 </html>

File diff suppressed because it is too large
+ 0 - 0
js/dist/excel-preview.min.js


+ 1 - 0
js/src/excel-preview.js

@@ -67,6 +67,7 @@
 
             initTabs(ele, sheetNames, workbook);
             $(event.target).data('excel-data', getTableData(workbook.Sheets[sheetNames[0]]));
+            $(event.target).trigger('excel-data-change');
             // //根据表名获取对应某张表
             // var worksheet = workbook.Sheets[sheetNames[0]];
         }

Some files were not shown because too many files changed in this diff