From 90b5260fbf5d84fc1b000c51ca78cdc48636acab Mon Sep 17 00:00:00 2001 From: jiaowang84 Date: Wed, 16 Aug 2017 22:19:49 +0800 Subject: [PATCH] Add e.preventDefault() in download function --- lib/index.js | 3 ++- src/index.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 32359bc..e782c10 100644 --- a/lib/index.js +++ b/lib/index.js @@ -161,9 +161,10 @@ var Workbook = exports.Workbook = function (_Component3) { } }, { key: 'download', - value: function download() { + value: function download(e) { var _this4 = this; + e.preventDefault(); var wb = { SheetNames: _react2.default.Children.map(this.props.children, function (sheet) { return sheet.props.name; diff --git a/src/index.js b/src/index.js index 24d7d6d..644fb5c 100644 --- a/src/index.js +++ b/src/index.js @@ -113,7 +113,8 @@ export class Workbook extends Component { return sheetData } - download () { + download (e) { + e.preventDefault(); const wb = { SheetNames: React.Children.map(this.props.children, sheet => sheet.props.name), Sheets: {}