<template>
<div class="lin-container">
<div class="lin-wrap-ui">
<el-card class="box-card" style="margin-bottom:50px;padding-bottom:20px;">
<div class="block-box">
<el-row class="input-row" v-for="(item, index) in list" :key="index">
<el-select class="el-select" v-model="item.label">
<el-option
v-for="(item, index) in addList"
:key="index + 1"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
<el-input v-model="item.text" placeholder="请输入内容" class="input-detail"></el-input>
<div class="function">
<i class="el-icon-remove" v-if="list.length-1" @click="removeContent(index)"></i>
<i class="el-icon-circle-plus" v-if="index === list.length - 1" @click="addContent"></i>
</div>
</el-row>
<el-button type="primary" @click="submit">主要按钮</el-button>
</div>
</el-card>
</div>
</div>
</template>
list: [{ text: "", type: "" }],
addList: [
{
value: "老板",
label: "老板"
},
{
value: "经理",
label: "经理"
}
]
addContent() {
this.list.push({text: ""});
},
removeContent(index) {
this.list.splice(index, 1);
},
submit(){
console.log(this.list)
}