擅长:python、mysql、java
<p>这对我有效,但我有一个奇怪的用法(directline嵌入到Sharepoint页面中,即不是绝对/固定位置):</p>
<pre><code> const store = window.WebChat.createStore(
{},
({ dispatch }) => next => action => {
if (action.type === 'DIRECT_LINE/POST_ACTIVITY_FULFILLED') {
var scrollDiv = $('ul[role="list"]').first().parent();
scrollDiv.scrollTop(scrollDiv[0].scrollHeight);
}
return next(action);
}
);
window.WebChat.renderWebChat(
{
directLine: window.WebChat.createDirectLine({
token: 'mySecret'
}),
store,
...
</code></pre>
<p>希望它能帮助别人。在</p>
<p>如果不想使用jQuery,请将2个scrollDiv行替换为:</p>
^{pr2}$