<template>
	<uv-swipe-action>
		<view
		v-for="(item, index) in list"
		class="item"
		:key="index"
		>
			<uv-swipe-action-item 
			@click="e => clickSwipeAction(e, item)"
			:options="options">
				<userItem :item="keyName ? item[keyName] : item"
				:createTime="item.createTime"/>
			</uv-swipe-action-item>
		</view>
	</uv-swipe-action>
</template>

<script>
	import userItem from './userItem.vue'
	export default {
		components : {
			userItem
		},
		props : {
			options : {
				default : [
					{
						text: '删除',
						style: {
							backgroundColor: '#FA5A0A'
						}
					}, 
				],
			},
			list : {
				default : []
			},
			keyName : {
				default : ''
			},
		},
		data() {
			return {
				
			}
		},
		methods: {
			clickSwipeAction(e, item){
				this.$emit('clickSwipeAction', {e, item})
			},
		}
	}
</script>

<style scoped lang="scss">
	.item{
		margin: 20rpx;
		border-radius: 20rpx;
		overflow: hidden;
	}
</style>
