You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
1.2 KiB
Vue
76 lines
1.2 KiB
Vue
4 years ago
|
<template>
|
||
|
<!-- #ifndef APP-NVUE -->
|
||
|
<view class="uni-list">
|
||
|
<slot />
|
||
|
</view>
|
||
|
<!-- #endif -->
|
||
|
<!-- #ifdef APP-NVUE -->
|
||
|
<list class="uni-list" :enableBackToTop="enableBackToTop" loadmoreoffset="15" :scroll-y="scrollY" @loadmore="loadMore">
|
||
|
<slot />
|
||
|
</list>
|
||
|
<!-- #endif -->
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
/**
|
||
|
* List 列表
|
||
|
* @description 列表组件
|
||
|
* @tutorial https://ext.dcloud.net.cn/plugin?id=24
|
||
|
*/
|
||
|
export default {
|
||
|
name: 'UniList',
|
||
|
'mp-weixin': {
|
||
|
options: {
|
||
|
multipleSlots: false
|
||
|
}
|
||
|
},
|
||
|
props: {
|
||
|
enableBackToTop: {
|
||
|
type: [Boolean, String],
|
||
|
default: false
|
||
|
},
|
||
|
scrollY: {
|
||
|
type: [Boolean, String],
|
||
|
default: false
|
||
|
}
|
||
|
},
|
||
|
provide() {
|
||
|
return {
|
||
|
list: this
|
||
|
}
|
||
|
},
|
||
|
created() {
|
||
|
this.firstChildAppend = false
|
||
|
},
|
||
|
methods: {
|
||
|
loadMore(e) {
|
||
|
this.$emit("scrolltolower");
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
<style lang="scss" scoped>
|
||
|
.uni-list {
|
||
|
/* #ifndef APP-NVUE */
|
||
|
display: flex;
|
||
|
/* #endif */
|
||
|
background-color: $uni-bg-color;
|
||
|
position: relative;
|
||
|
flex-direction: column;
|
||
|
// border-bottom-color: $uni-border-color;
|
||
|
// border-bottom-style: solid;
|
||
|
// border-bottom-width: 1px;
|
||
|
}
|
||
|
|
||
|
/* #ifndef APP-NVUE */
|
||
|
.uni-list:before {
|
||
|
height: 0;
|
||
|
}
|
||
|
|
||
|
.uni-list:after {
|
||
|
height: 0;
|
||
|
}
|
||
|
|
||
|
/* #endif */
|
||
|
</style>
|