<template>
    <view style="background-color: #fafafa">
        
		<uni-pagination  :total="total" :pageSize="pageSize"  :current="currents" 
			
			 @change="changePage" />
		<view style="font-size: 14px;text-align: center; ">
			当前页：{{ currents }}，每页数据：{{ pageSize }}，数据总量：{{ total }}条
		</view>

    </view>

</template>

<script>
    export default {
        name: 'paginations',
		
        data() {
            return {			
				currents: this.current, 	//当前页		
            }
        },
		
		watch: {
		    current (newName, oldName) {
				this.currents = newName
		        
		    }
		},
        onLoad(option) {

        },
		props: {
			loding: {
				type:Boolean,
				default:true,
			},
			current: {
			    type: Number,
				default:1,
			},
		    pageNum: {
		        type: Number,
		    },
		    pageSize: {
		        type: Number,
		    },
		    total: {
		        type: Number,
		    },
		
		},
        
        methods: {
            //监听页数变化
            changePage(e) {
            	
				this.currents = e.current			
				this.$emit('changevalue', e.current	)
            },
        },
        created() {
           
        }
    }
</script>

<style scoped lang="scss">
    
</style>
