一,循环使用el-input简单例子分析
<template>
<div>
<div v-for="(item,index) in list" :key="index">
<div>{
{item}}</div>
<el-input type="text" v-model="item.label" @change="aa(item)"></el-input>
</div>
</div>
</template>
<script>
export default {
data(){
return {
list:[
{
number: 1001,
label: "",
},
{
number: 1001,
label: "",
},
{
number: 1001,
label: "",
},
{
number: 1001,
label: "",
},
]
}} ,
methods: {
aa(data){
alert(data.label)
}
}