<template>
	<view class="niu-grid" :class="{center}" :style="[gridStyle]">
		<view class="niu-grid-item">
			<slot></slot>
		</view>
	</view>
</template>

<script>
	export default{
		name: "niu-grid",
		props:{
			num: {
				type: Number,
				default: 5
			},
			hover: {
				type: Boolean,
				default: true
			},
			center: {
				type: Boolean,
				default: false
			},
			type: {
				type: String,
				default: 'icon'
			},
			gridStyle: {
				type: Object,
				default: ()=>{}
			},
			rect: {
				type: String,
				default: '80rpx'
			},
		},
		methods: {
			registerGridItem(){
				console.log(222);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.niu-grid{
		box-sizing: border-box;
		&.center{
			display: flex;
			align-items: center;
			justify-content: center;
			.niu-grid-item{
				margin: 0;
			}
		}
		.niu-grid-item{
			display: flex;
			// align-items: center;
			flex-wrap: wrap;
		}
	}
</style>