[英]promise is undefined in IE11 when using axios in ReactJS
我將我的反應代碼覆蓋到打字稿並使用axios進行網絡調用。 在IE11中運行時,出現錯誤“未定義承諾”
我知道我需要使用polyfill,但是如何使用? 我沒有使用Babel和Webpack。
我使用了babel-polyfill.js,錯誤消失了,但是出現了這個錯誤
未捕獲的Sys.ParameterCountException:Sys.ParameterCountException:參數計數不匹配。
知道我該怎么辦嗎?
tsconfig.json
{
"compilerOptions": {
"module": "UMD",
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true,
"jsx": "react",
"lib": ["DOM","ES6","DOM.Iterable","ScriptHost"],
"typeRoots": []
},
"include": [
"*.tsx"
],
"exclude": [
"node_modules"
]
}
abc.tsx
import axios = require('../../Scripts/axios');
import * as React from 'react';
import * as ReactDOM from 'react-dom';
class abc extends React.Component<Props, state> {
function renderabc(res){
ReactDOM.render(
<abc resources={res}/>,
document.getElementById('abc_React')
);
}
export abc;
預期結果:axios在IE11上工作
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.