We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e40d6b commit 9bfdbe1Copy full SHA for 9bfdbe1
packages/pro-components/chat/chat-list/_example/base/index.js
@@ -67,6 +67,13 @@ Component({
67
},
68
69
methods: {
70
+ // 调用chatList的滚动到底部方法
71
+ scrollToBottom() {
72
+ const chatListComponent = this.selectComponent('#chatList');
73
+ if (chatListComponent && typeof chatListComponent.scrollToBottom === 'function') {
74
+ chatListComponent.scrollToBottom();
75
+ }
76
+ },
77
onScroll(e) {
78
console.log('监听滚动', e);
79
packages/pro-components/chat/chat-list/_example/base/index.wxml
@@ -1,5 +1,5 @@
1
<view class="chat-box" style="height: {{contentHeight}};">
2
- <t-chat bindscroll="onScroll">
+ <t-chat id="chatList" bindscroll="onScroll">
3
<block wx:for="{{chatList}}" wx:key="index">
4
<t-chat-message
5
avatar="{{item.avatar || ''}}"
0 commit comments