0.2.5 • Published 1 year ago
chat-miniprogram v0.2.5
使用方法
npm
方式
- 在项目目录下安装组件包
npm install chat-miniprogram
开发者工具中勾选 使用 npm 模块(若没有此选项则不需要)并点击 工具 - 构建 npm
在需要使用页面的 json 文件中添加
{
"usingComponents": {
"chat": "/miniprogram_npm/chat-miniprogram"
}
}
- 在需要使用页面的 wxml 文件中添加
<chat xxx="{{xxx}}" />
源码方式
- 将源码中对应平台的代码包(
miniprogram_dist
)拷贝到components
目录下,更名为chat-miniprogram
- 在需要使用页面的 json 文件中添加
{
"usingComponents": {
"chat": "/components/chat-miniprogram/index"
}
}
后续步骤同上
组件属性
属性 | 类型 | 说明 |
---|---|---|
companyName | String | 企业名称 |
iconList | Object | 图标列表 |
mode | String | 咨询方式 |
firstQuestion | String | 进入页面携带的问题 |
api
名称 | 作用 |
---|---|
onSubmit | 提交问题 |
getListMsg | 获取对话列表 |
updateVideoSrc | 更新视频源地址 |
KeyWords
miniprogram