nvue子组件中使用scroll-view组件scrolltolower回调不会触发
Detail.nvue中引入CommentListView.nvue
<template>
<view class="CommentListLayout" :class="mCommentList.length > 0 ? '' : 'EmptyListLayout'">
<template v-if="mCommentList.length > 0">
<!-- #ifdef APP-NVUE -->
<list class="scroll-v list" enableBackToTop="true" scroll-y loadmoreoffset="15" @loadmore="loadMore(index1)">
<refresh class="refresh" @refresh="onrefresh(index1)" @pullingdown="onpullingdown" :display="refreshing ? 'show' : 'hide'">
<div class="refresh-view">
<image class="refresh-icon" :src="refreshIcon" :style="{width: (refreshing || pulling) ? 0: '30px'}"
:class="{'refresh-icon-active': refreshFlag}"></image>
<loading-indicator class="loading-icon" animating="true" v-if="refreshing"></loading-indicator>
<text class="loading-text">{{refreshText}}</text>
</div>
</refresh>
<cell v-for="(bean,index2) in mCommentList" :key="bean.id">
<CommentItemView :index="index2" :databean="bean" @close="dislike(index1,index2)" @click="goDetail(bean)"></CommentItemView>
</cell>
<cell class="loading-more" v-if="isLoading || mCommentList.length > 4">
<text class="loading-more-text">{{loadingText}}</text>
</cell>
</list>
<!-- #endif -->
<!-- #ifndef APP-NVUE -->
<scroll-view class="scroll-v list" enableBackToTop="true" scroll-y @scrolltolower="loadMore(index1)">
<view v-for="(bean,index2) in mCommentList" :key="bean.id">
<CommentItemView :index="index2" :databean="bean" @close="dislike(index1,index2)" @click="goDetail(bean)"></CommentItemView>
</view>
<view class="loading-more" v-if="isLoading || mCommentList.length > 4">
<text class="loading-more-text">{{loadingText}}</text>
</view>
</scroll-view>
<!-- #endif -->
</template>
<template v-else>
<view>
<image class="empty_layout_image" src="/static/mipmap/empty_data2.png" mode=""></image>
<text class="empty_text_view">还没有人评论哦</text>
</view>
</template>
</view>
</template>
目前还没在android真机上调试,在H5里面不进scrolltolower方法
2 个回复
2***@qq.com
到处都是bug,半年了这个问题还在
笑望哥
问题解决了。回调方法要写在methods中,没注意copy的时候放错位置了