A chat bot component for CIRS
npm install chat-bot-for-cirs一个基于 React 和 Ant Design 的聊天机器人组件,专为 CIRS 系统设计。
``bash`
npm install chat-bot-for-cirs
`jsx
import React from 'react';
import ChatBot from 'chat-bot-for-cirs';
function App() {
return (
export default App;
`
`jsx
import React, { useState } from 'react';
import ChatBot from 'chat-bot-for-cirs';
function App() {
const [expanded, setExpanded] = useState(false);
const handleExpandedChange = (newExpanded) => {
setExpanded(newExpanded);
console.log('聊天窗口状态:', newExpanded ? '展开' : '收起');
};
return (
export default App;
`
`html`
| 属性 | 类型 | 默认值 | 描述 |
|------|------|--------|------|
| expanded | boolean | false | 是否展开聊天窗口 |
| onExpandedChange | (expanded: boolean) => void | - | 展开状态变化回调 |
| className | string | - | 自定义样式类名 |
| style | React.CSSProperties | - | 自定义样式 |
| config | object | - | 聊天机器人配置 |
| 属性 | 类型 | 默认值 | 描述 |
|------|------|--------|------|
| apiEndpoint | string | - | API 端点 |
| headers | Record
- dist/index.js - CommonJS 格式dist/index.esm.js
- - ES Module 格式dist/index.umd.js
- - UMD 格式(未压缩)dist/index.min.js
- - UMD 格式(压缩版)dist/index.d.ts` - TypeScript 类型声明
-
- React >= 18.0.0
- ReactDOM >= 18.0.0
- antd ^4.24.16
- @ant-design/icons
- react-markdown
MIT