代码如下,web正常,小程序端scrolltoupper、scroll事件都不调用
<KScrollView
class="box-chat"
id="boxChat"
:scroll-y="true"
:scroll-anchoring="true"
@scrolltoupper="scrollToUpper"
@scroll="scroll"
:scroll-into-view="scrollTo"
>
<KView check-reduce class="box-loading" id="boxLoading">
<span class="loading" v-if="hasMore === 0">加载中...</span>
<span class="not-more" v-if="hasMore === 2">没有更多消息了</span>
<span class="not-more" v-if="hasMore === 3">暂无消息</span>
<span class="load-more" v-if="hasMore === 1" @click="loadingHistory()">加载更多消息</span>
</KView>
<KView v-for="(v, i) in messageList" :key="i" :id="'msg-' + v.id">
<chat-message :msg="v" :online="isUserOnline"></chat-message>
</KView>
</KScrollView>
找到问题了高度设置问题,flex布局,使用KScrollView设置了flex:1,再加个height:100%就可以了
但是scroll-into-view属性依旧不能用,web正常会滚动到对应位置,但小程序不会
唉,我这几天也在用kbone-ui,基本上每个组件都有bug,真遭罪