我正在使用 react 构建我的网页。我想将减速器的存储数据下载到 xlxs 文件中。为此,我正在使用exceljs
包。我已经安装了exceljs
使用npm i exceljs
.
但是当我尝试导入exceljs
我的组件时,我正在TypeError: Cannot read property 'prototype' of undefined
屏幕上。
我正在使用命令导入import Excel from "exceljs";
。
我的 package.json 是:
{
"name": "xxxxxxx_xxxxx",
"version": "0.1.0",
"private": true,
"dependencies": {
"exceljs": "^1.6.0",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-intl": "^2.4.0",
"react-redux": "^5.0.7",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-scripts": "1.1.4",
"redux": "^4.0.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0"
},
"scripts": {
"start": "react-scripts start",
"build:langs": "NODE_ENV='production' ./node_modules/.bin/babel src --out-dir lib",
"build:locale": "NODE_ENV='production' babel-node scripts/translator.js",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-plugin-react-intl": "^2.4.0"
}
}