【发布时间】:2019-08-09 07:06:37
【问题描述】:
带有 react 的 botframework 在 IE 中不起作用,
我正在使用类似于
https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/03.a.host-with-react 的索引 html 文件,它在 chrome 中工作但在 IE 中不工作,我也尝试使用 webchat-es5.js。
我正在使用机器人团队提供的令牌。
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Web Chat: Integrate with React</title>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<script src="https://unpkg.com/react@16.5.0/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16.5.0/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/react-redux@5.0.7/dist/react-redux.min.js"></script>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat-es5.js"></script>
<style>
html, body { height: 100% }
body { margin: 0 }
#webchat {
height: 100%;
width: 100%;
}
</style>
</head>
<div id="webchat" role="main"></div>
<script type="text/babel">
function start() {
const { createStore, ReactWebChat } = window.WebChat;
const { Provider } = window.ReactRedux;
const store = createStore();
window.ReactDOM.render(
<Provider store={ store }>
<ReactWebChat
directLine={ window.WebChat.createDirectLine({ token:'mytoken' }) }
storeKey="webchat"
/>
</Provider>,
document.getElementById('webchat')
);
document.querySelector('#webchat > *').focus();
}
start();
</script>
</body>
</html>
在 Chrome 中工作但不在 IE 中工作,请有人帮助我。
【问题讨论】:
-
您可以编辑您的帖子以包含您收到的错误吗?
标签: reactjs botframework chatbot web-chat