This repository has been archived on 2024-04-29. You can view files and clone it, but cannot push or open issues or pull requests.
node-fftcg/frontend/src/views/Game.vue

33 lines
573 B
Vue
Raw Normal View History

<template lang="html">
<div ref="game" />
</template>
<script>
export default {
name: 'Game',
mounted() {
this.$nextTick(function() {
try {
// framework
require('craftyjs/dist/crafty')
// initialize on ref="game"
window.Crafty.init(this.$refs.game)
window.Crafty.stage.fullscreen = true
// load fftcg
require('@/crafty/Game.coffee')
} catch (e) {
window.location.reload()
}
})
},
beforeDestroy() {
window.Crafty.stop(true)
delete window.Crafty
}
}
</script>