<template>
<view>
<view v-for="(item, index) in students" class="persons" @click="menuClick" v-bind:id="index">{{index}} - {{item.name}}</view>
</view>
</template>
<script>
export default {
data: {
students : [
{name : "张三", age : 18},
{name : "李四", age : 20}
]
},
methods:{
menuClick : function(e){
console.log(e);
console.log(e.target.id);
}
},
}
</script>
<style>
.persons{width:750px; line-height:2.2em;}
</style>