<template>
	<scroll-view class="scroll-view" @scrolltolower="onScrollTolower" scroll-y>
		<slot />
		<uni-load-more v-if="(loaded&&status!='noMore')||(!loaded && status=='noMore')" :status="status"
			:content-text="contentText" />
		<view class="blank"></view>
	</scroll-view>
</template>
<script setup>
	import {
		ref,
		computed
	} from 'vue';
	const emit = defineEmits(['next'])
	const props = defineProps({
		loaded: {
			type: Boolean,
			default: false
		},
		status: {
			type: String,
			default: "loading"
		},
		text: {
			type: String,
			default: "数据加载中..."
		}
	})

	const contentText = computed(() => {
		let _text = {
			contentdown: props.text,
			contentrefresh: props.text,
			contentnomore: '没有更多数据了',
		}
		return _text;
	})

	//顶部tab点击
	const onScrollTolower = () => {
		emit('next')
	}
</script>


<style lang="scss" scoped>
	.scroll-view {
		.blank {
			height: 1rpx;
			width: 100%;
		}
	}
</style>