make target element mandatory for main func

This commit is contained in:
Zutatensuppe 2021-05-13 17:20:10 +02:00
parent 8e7aa7d453
commit 5adb8806dc
5 changed files with 34 additions and 16 deletions

View file

@ -1,5 +1,7 @@
"use strict"
import main from './../game.js'
export default {
name: 'replay',
template: `<div>{{replayData}}</div>`,
@ -21,6 +23,11 @@ export default {
const res = await fetch(`/api/replay-data/${this.$route.params.id}`)
const json = await res.json()
this.replayData = json
window.GAME_ID = this.gameData.GAME_ID
window.WS_ADDRESS = this.gameData.WS_ADDRESS
window.MODE = 'replay'
main(this.$el)
},
},
}