<template>
<div class='elCustomVariable'>
<el-form label-width="80px">
<el-form-item v-for="(item, index) in dataList" :key="index" :label="item.label">
<el-input v-model="item.value" @change="((value)=>{handleChange(value, item.label, index)})"></el-input>
</el-form-item>
</el-form>
</div>
</template>
<script>
export default {
name: 'elCustomVariable',
data () {
return {
dataList: [
{
label: '输入框1',
value: ''
}, {
label: '输入框2',
value: ''
}
]
}
},
methods: {
handleChange (value, label, index) {
console.log(value, label, index)
}
}
}
</script>