课程章节: excel 、zip 与前端结合解决方案之用户管理页面实现
主讲老师: Sunday
课程内容:
今天学习的内容包括:
用户管理页面的实现
课程收获:
8.1 心得:
"use strict";
Component({
properties: {
list: {
type: Array,
value: [],
observer: "onListChange"
},
loadMore: {
type: Object,
value: {
enableLoadMore: false,
hasMore: true,
},
observer: "onLoadMoreChange"
},
},
data: {
enableLoadMore: false,
hasMore: true,
},
methods: {
onListChange: function onListChange() {
this.setData({
list: this.data.list,
});
},
/**
* list里面item内部点击
* 可通过e.detail.clickEvent.target知道是Item内部哪个子控件自身点击事件
* @param {*} e
*/
onClickItem: function onClickItem(e) {
// console.log(e);
this.triggerEvent('onClickListItem', e.detail);
},
/**
* 加载更多控件更新
*/
onLoadMoreChange: function onLoadMoreChange() {
this.setData({
enableLoadMore: this.data.loadMore.enableLoadMore,
hasMore: this.data.loadMore.hasMore,
});
},
}
});
.container {
display: flex;
flex-direction: column;
background-color: #fff;
margin: 0;
padding: 0;
width: 100%;
box-sizing: border-box;
}
.loadmore_parent {
text-align: center;
flex-shrink: 0;
width: 100%;
background-color: #f8f9fa
}
.loading {
width: 64rpx;
height: 64rpx;
margin-top: 32rpx;
margin-bottom: 32rpx;
display: inline-block
}
.loadmore {
font-size: 14rpx;
height: 160rpx;
text-align: center
}
.loadmore, .loadmore-end-container {
width: 100%
}
.loadmore-end {
padding-bottom: 48rpx;
padding-top: 48rpx
}
.loadmore-tip {
width: auto;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center
}
.loadmore-end-tip {
width: auto;
height: 34rpx;
font-size: 24rpx;
line-height: 34rpx;
margin-right: 14rpx;
margin-left: 14rpx;
display: inline-block;
color: #888;
flex-shrink: 0
}
.loadmore-end-line {
width: auto;
height: 1px;
flex-grow: 1;
margin-right: 32rpx;
margin-left: 32rpx;
background: #e5e5e5;
display: inline-block;
vertical-align: middle
}