Splice fix
This commit is contained in:
parent
bfadb57694
commit
56e13c79ca
|
@ -21,7 +21,7 @@ export default Vue.extend({
|
||||||
},
|
},
|
||||||
close: function (toast) {
|
close: function (toast) {
|
||||||
// Wait for fade-out to finish
|
// Wait for fade-out to finish
|
||||||
setTimeout(this.remove, 300, this.toasts.length)
|
setTimeout(this.remove, 300, 0)
|
||||||
|
|
||||||
toast.isOpen = false
|
toast.isOpen = false
|
||||||
},
|
},
|
||||||
|
@ -36,7 +36,7 @@ export default Vue.extend({
|
||||||
},
|
},
|
||||||
remove: function(index) {
|
remove: function(index) {
|
||||||
const removed = this.toasts.splice(index, 1)
|
const removed = this.toasts.splice(index, 1)
|
||||||
clearTimeout(removed.timeout)
|
clearTimeout(removed[0].timeout)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue