More vue updates

This commit is contained in:
Henrique Dias
2017-06-30 10:25:35 +01:00
parent 289171c092
commit 2789ff2161
21 changed files with 421 additions and 136 deletions

View File

@@ -0,0 +1,24 @@
// Removes an element, if exists, from an array
function removeElement (array, element) {
var i = array.indexOf(element)
if (i !== -1) {
array.splice(i, 1)
}
return array
}
// Replaces an element inside an array by another
function replaceElement (array, oldElement, newElement) {
var i = array.indexOf(oldElement)
if (i !== -1) {
array[i] = newElement
}
return array
}
export default {
remove: removeElement,
replace: replaceElement
}