botframework - botframework v4 自定义标题和最小化网络聊天
问题描述
我正在使用这个渲染我的聊天:
<!DOCTYPE html>
<html>
<head>
<style>
html, body {
height: 100%;
}
body {
margin: 0;
}
.main {
margin: 18px;
border-radius: 4px;
}
div[role="form"] {
background-color: black;
}
div[role="log"] {
background: gainsboro;
}
div[role="status"] {
background: darkgray;
}
#webchat {
position: fixed;
height: calc(100% - 135px);
z-index: 9999;
width: 400px;
top: 132px;
overflow: hidden;
border-color: red;
border-style: dotted;
visibility:visible;
}
</style>
</head>
<body>
<div>
<div id="heading">
<div id="heading">
<h1><img src="mylogo.png"> mychat</h1>
</div>
</div>
<div id="webchat" role="main"></div>
</div>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
<script>
openchat();
function openchat() {
const styleOptions = {
userID: 'YOUR_USER_ID',
username: 'Web Chat User',
botAvatarInitials: '',
userAvatarInitials: 'You',
bubbleBackground: 'rgba(0, 255, 50, .4)',
bubbleFromUserBackground: 'rgba(125, 125, 125, .3)',
botAvatarImage: 'mylogo.png'
};
window.WebChat.renderWebChat(
{
directLine: window.WebChat.createDirectLine({
token: '*'
}),
styleOptions
},
document.getElementById('webchat')
);
}
</script>
</body>
</html>
它工作正常,但现在我需要在公司的网页上发布这个聊天,作为弹出窗口或类似的东西,所以使用以前的脚本是可以的,但我没有选择向弹出窗口添加标题,我也需要添加一个最小化按钮。如何在主页内为我的网络聊天设置标题和最小化按钮?
发送,
解决方案
我认为您最好的选择是使用网络聊天团队提供的示例。最小化网络聊天示例就是一个很好的例子。
推荐阅读
- node.js - React / Next,使用passport.js的Express应用程序无需注册即可登录帐户?
- gradle - 所有存储库中的 Gradle 依赖项更新
- c++ - 如果 MPI 程序中的一个进程比其他进程执行得慢怎么办?
- java - 方法的 Java 接口类型声明
- c++ - 分段错误(核心转储) - 二维数组
- python - 我在 numpy 中实现的多通道 1d 卷积有什么问题(与 tensorflow 相比)
- vue.js - 如何在 Vue CLI 中修改 e2e 测试的位置?
- c# - 如何存储从 HTTPPost web api 方法获取的设备令牌
- java - 无法在 Java 11 上运行的 Wildfly 17 中运行 JMX Exporter
- python - 抓取滚动时加载内容的动态网站