javascript - web 应用程序上的 react-chatbot-kit
问题描述
我一直在尝试在普通的 html/css/js 网站上使用 react-chatbot-kit,使用编译良好的 webpack 包。但是,弹出窗口不会显示在网页上。已尝试使用 react-simple-chatbot 进行相同的操作,并且效果很好。它不适用于 react-chatbot-kit。
将不胜感激帮助解决它。提前致谢!
干杯
index.js 中使用 react-chatbot-kit 的代码粘贴在下面。
import React from 'react';
import ReactDOM from 'react-dom';
import Chatbot from 'react-chatbot-kit';
import ActionProvider from './components/react-chatbot-kit/ActionProvider';
import MessageParser from './components/react-chatbot-kit/MessageParser';
import config from './components/react-chatbot-kit/config';
import { ThemeProvider } from 'styled-components';
const chatwindowconfig ={
width: "350px",
height: "500px",
floating: true,
};
ReactDOM.render(
<div>
<h1>This is the bundle from React!</h1>
<ThemeProvider theme={theme}>
<ChatBot
config={config}
MessageParser={MessageParser}
ActionProvider={ActionProvider}
{...chatwindowconfig}
/>
</ThemeProvider>
</div>,
document.getElementById('root')
)
解决方案
推荐阅读
- powershell - WPF - 单击 ListView 中的项目
- javascript - Discord.js 如何在嵌入中添加customemoji?
- c++ - 在 VS19 中调试 C++ 时出现错误代码 0x80070002
- python - 我们如何使用 Python 脚本安排 Jenkins 作业?
- html - 子项与其父项之间的 margin-top
- javascript - 单击按钮时动态删除列表Javascipt
- php - PHP 操作 $_Session 数组购物车
- database - N1QL 使用文档中的 ID 从存储桶中获取数据。我看不到我的结果
- multithreading - 如何在 Hammerspoon 初始化中实现周期性任务?
- compiler-construction - BNF 歧义