
<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>
您發布的評論即表示同意遵守以下條款:
一、不得利用本站危害國家安全、泄露國家秘密,不得侵犯國家、社會、集體和公民的合法權益;
二、不得發布國家法律、法規明令禁止的內容;互相尊重,對自己在本站的言論和行為負責;
三、本站對您所發布內容擁有處置權。