12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <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>
- 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;
- /* #ifdef MP-WEIXIN */
- width:690rpx;
- margin: auto;
- margin-top: 20rpx;
- background: #ffffff;
- box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
- border-radius: 20rpx;
- /* #endif */
- // 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>
|