Ação de despacho de Vue em Tab Close

let that = this
window.addEventListener("beforeunload", function(event) {
    event.preventDefault();
    // problem line 
    that.$store.dispatch('CURR_TERMINAL_ACTION', that.id)
})
Krushn