<template>
	<scroll-view class="cu-scrollView" @scrolltolower="$emit('scrolltolower')" refresher-enabled @refresherpulling="refresherpulling" @scroll="scrollFunc"  :refresher-triggered="triggered" scroll-with-animation :style="{height}" scroll-y="true" >
		<slot />
	</scroll-view>
</template>

<script>
	export default {
		props:{
			height:{type:String,default:'100vh'}
		},
		data(){
			return {
				triggered:false
			}
		},
		methods:{
			async refresherpulling(){
				this.triggered=true;
				await this.$emit('refresherpulling');
				this.triggered=false;
			},
			scrollFunc(e){
				this.$emit('scroll',e)
			}
		}
	}

	
</script>

<style lang="scss" scoped>
.cu-scrollView{
	transition: height .3s linear;
}
</style>