引入后, 在小程序端 loadMore 区域展示 Undefined
H5 端没问题
2种引入方式都已尝试 : 在小程序内均展示为 Undefined
1: 本地 components 文件下 已经下载load-more.vue 文件
import uniLoadMore from "@/components/load-more/load-more.vue"
2: npm install @dcloudio/uni-ui 安装
import { uniLoadMore } from '@dcloudio/uni-ui'
页面 template 内
<view class="ul">
<view class="li" v-for="(item,index) in orderList" :key="index">
</view>
<uni-load-more :status="status" :show-icon="true" v-if="showLoadMore"></uni-load-more>
</view>
页面 data 内
status: 'more',
showLoadMore: true,
loadMoreText: "加载中...",
页面 执行的方法
// 监听页面卸载
onUnload() {
this.max = 0,
this.orderList = [],
this.status = "more",
this.showLoadMore = false;
},
// 上拉加载
onReachBottom() {
var that = this;
console.log("onReachBottom");
that.status = 'loading';
that.showLoadMore = true;
setTimeout(() => {
that.newCurrent += 1;
that.listFn(that.newCurrent,that.newPagesSize);
}, 300);
},
// 下拉刷新
onPullDownRefresh() {
console.log('onPullDownRefresh');
this.newCurrent = 1;
this.newPagesSize = 10;
setTimeout(() => {
this.listFn(this.newCurrent,this.newPagesSize);
}, 300);
},
methods: {
listFn(nowCurrent,nowSize) {
// 数据进行渲染
},
}
左侧为H5端,右侧为小程序端