需求:点击加号动态添加表单项站点和通道,当站点和通道有多个时允许删除,只有一个时不能删除,删除按钮隐藏
先来看看效果吧
默认初始效果:
点击加号动态新增表单项后:
上代码:
<template>
<div class="select-site-ipc" v-for="(item,index) in alarmRuleForm.alarmSourceArray"
:key=index>
<div class="site-box">
<el-form-item class="site-item" :prop="'alarmSourceArray.' + index + '.siteId'" :rules="[{ required:true,message:$translate('errorCode.33042'), trigger: 'change' }]">
<el-select
ref='sceneSelect