赞
踩
- <div
- v-for="(item, index) in ruleForm.networkCardArray"
- :key="item.key"
- class="dynamic-box"
- >
- <el-form-item
- label="经度"
- :prop="'networkCardArray.' + index + '.ksLong'"
- :rules="{
- required: true,
- message: '经度不能为空',
- trigger: 'blur',
- }"
- >
- <el-input
- v-model="item.ksLong"
- type="number"
- placeholder="数字类型"
- ></el-input>
- </el-form-item>
- <el-form-item
- label="纬度"
- :prop="'networkCardArray.' + index + '.ksLat'"
- :rules="[
- {
- required: true,
- message: '纬度不能为空',
- trigger: 'blur',
- },
- ]"
- >
- <el-input
- v-model="item.ksLat"
- type="number"
- placeholder="数字类型"
- ></el-input>
- </el-form-item>
- <el-form-item>
- <i
- v-show="ruleForm.networkCardArray.length > 2"
- class="el-icon-delete"
- @click="removeDomain(item, index)"
- ></i>
- </el-form-item>
- </div>
- <el-form-item style="display: block; text-align: center">
- <el-button @click="addJWItem" type="primary"
- >新增可用区域经纬度</el-button
- ></el-form-item >
点击新增
- // 新增经纬度表单项
- addJWItem() {
- this.ruleForm.networkCardArray.push({
- ksLat: '',
- ksLong: '',
- })
- },
点击删除
- // 点击删除经纬度项
- removeDomain(item, index) {
- const itemList = this.ruleForm.networkCardArray.indexOf(item)
- if (itemList !== -1) {
- this.ruleForm.networkCardArray.splice(index, 1)
- }
- },
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。