<template>
	<view>
		<!-- 基于 uni-list 的页面布局 -->
		<uni-list>
			<uni-list-item class="slot-box-item" direction="row" v-for="item in elderList" :key="item.id" :title="item.name"
			 clickable="true" @click="selectedElderAction(item)">
			</uni-list-item>
			
		</uni-list>
	</view>
</template>


<script>
	export default {
		onLoad() {
			this.getElderList();
		},
		
		data() {
			return {
				elderList:[]
			}
		},
		methods: {
			selectedElderAction: function(elder) {				
				uni.$emit('selectElder', {
				    elder: elder
				});
				
				uni.navigateBack({})
			},
			getElderList: function(e) {
				this.elderList = [{'id':'001', 'name':'王大爷'},
								  {'id':'002', 'name':'李大爷'},
								  {'id':'003', 'name':'张大爷'}]
			}
		}
	}
</script>

<style>

</style>
