make target element mandatory for main func
This commit is contained in:
parent
8e7aa7d453
commit
5adb8806dc
5 changed files with 34 additions and 16 deletions
|
|
@ -1,5 +1,7 @@
|
|||
"use strict"
|
||||
|
||||
import main from './../game.js'
|
||||
|
||||
export default {
|
||||
name: 'game',
|
||||
template: `<div>{{gameData}}</div>`,
|
||||
|
|
@ -21,6 +23,11 @@ export default {
|
|||
const res = await fetch(`/api/game-data/${this.$route.params.id}`)
|
||||
const json = await res.json()
|
||||
this.gameData = json
|
||||
|
||||
window.GAME_ID = this.gameData.GAME_ID
|
||||
window.WS_ADDRESS = this.gameData.WS_ADDRESS
|
||||
window.MODE = 'play'
|
||||
main(this.$el)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue