Add remove LOA button

This commit is contained in:
leigh-mil 2019-02-22 15:21:33 -05:00
parent 2d2f8d8d93
commit 9a7bcd6f29
2 changed files with 10 additions and 0 deletions

View File

@ -42,5 +42,11 @@ export default {
addLOA: function(event) {
this.loas.push(createLOA(''))
},
removeLOA: function(index) {
if (this.loas.length > 1) {
this.loas.splice(index, 1)
}
},
},
}

View File

@ -84,6 +84,10 @@
<input type="text" v-model='loa.number' :id="'loas-' + i" placeholder="1234567890"/>
<input type="hidden" :name="'loas-' + i" v-model='loa.number'/>
</div>
<button v-on:click="removeLOA(i)" v-if="loas.length > 1" type="button" class='application-edit__env-list-item__remover'>
{{ Icon('trash') }}
<span>Remove</span>
</button>
</li>
</ul>
<div class="task-order__loa-add-item">