botui
1.0.0
用于创建对话UI的JavaScript框架。
主站点 - 阅读文档 - 示例 - ? Quickstart
我们正在列出人们在这里与Botui一起构建的所有酷项目。查看别人的添加您的!
笔记
此版本正在使用完全不同的方法来构建UI。请勿将其用作上一个版本的倒入替换。如果要使用以前的(仅VUE)方法,请安装0.3.9版本: npm i [email protected] 。

npm i botui @botui/react import { useEffect } from 'react'
import { createRoot } from 'react-dom/client'
import { createBot } from 'botui'
import { BotUI , BotUIMessageList , BotUIAction } from '@botui/react'
const myBot = createBot ( ) < div id =" botui-app " > </ div > const App = ( ) => {
useEffect ( ( ) => {
myBot
. wait ( { waitTime : 1000 } )
. then ( ( ) => myBot . message . add ( { text : 'hello, what is your name?' } ) )
. then ( ( ) => myBot . action . set (
{
options : [
{ label : 'John' , value : 'john' } ,
{ label : 'Jane' , value : 'jane' } ,
] ,
} ,
{ actionType : 'select' }
) )
. then ( ( data ) => myBot . message . add ( { text : `nice to meet you ${ data . selected . label } ` } ) )
} , [ ] )
return < div >
< BotUI bot = { myBot } >
< BotUIMessageList />
< BotUIAction />
</ BotUI >
</ div >
}
const containerElement = document . getElementById ( 'botui-app' )
const root = createRoot ( containerElement )
root . render ( < App /> )MIT许可证 - 版权(C)2017-23 -Moin Uddin