Stripped App component to ExampleApp ~ fix reloading, resizing
This commit is contained in:
parent
4ee00885fe
commit
a6b9646b87
4 changed files with 57 additions and 36 deletions
|
@ -6,7 +6,7 @@
|
|||
"favorite": 0,
|
||||
"type": "vue",
|
||||
"name": "frontend",
|
||||
"openDate": 1556529929207,
|
||||
"openDate": 1556559984890,
|
||||
"widgets": [
|
||||
{
|
||||
"id": "5sGiztidd",
|
||||
|
|
|
@ -1,37 +1,11 @@
|
|||
<template>
|
||||
<v-app>
|
||||
<v-toolbar app>
|
||||
<v-toolbar-title class="headline text-uppercase">
|
||||
<span>Vuetify</span>
|
||||
<span class="font-weight-light">MATERIAL DESIGN</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn flat :to="{ path: '/' }">Home</v-btn>
|
||||
<v-btn flat :to="{ path: '/about' }">About</v-btn>
|
||||
<v-btn flat :to="{ path: '/game' }">Game</v-btn>
|
||||
<v-btn
|
||||
flat
|
||||
href="https://github.com/vuetifyjs/vuetify/releases/latest"
|
||||
target="_blank"
|
||||
>
|
||||
<span class="mr-2">Latest Release</span>
|
||||
<v-icon>open_in_new</v-icon>
|
||||
</v-btn>
|
||||
</v-toolbar>
|
||||
|
||||
<v-content>
|
||||
<router-view />
|
||||
</v-content>
|
||||
</v-app>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'App',
|
||||
data() {
|
||||
return {
|
||||
//
|
||||
}
|
||||
}
|
||||
name: 'App'
|
||||
}
|
||||
</script>
|
||||
|
|
36
frontend/src/ExampleApp.vue
Normal file
36
frontend/src/ExampleApp.vue
Normal file
|
@ -0,0 +1,36 @@
|
|||
<template>
|
||||
<v-app>
|
||||
<v-toolbar app>
|
||||
<v-toolbar-title class="headline text-uppercase">
|
||||
<span>Vuetify</span>
|
||||
<span class="font-weight-light">MATERIAL DESIGN</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn flat :to="{ path: '/' }">Home</v-btn>
|
||||
<v-btn flat :to="{ path: '/about' }">About</v-btn>
|
||||
<v-btn
|
||||
flat
|
||||
href="https://github.com/vuetifyjs/vuetify/releases/latest"
|
||||
target="_blank"
|
||||
>
|
||||
<span class="mr-2">Latest Release</span>
|
||||
<v-icon>open_in_new</v-icon>
|
||||
</v-btn>
|
||||
</v-toolbar>
|
||||
|
||||
<v-content>
|
||||
<router-view />
|
||||
</v-content>
|
||||
</v-app>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ExampleApp',
|
||||
data() {
|
||||
return {
|
||||
//
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -1,21 +1,32 @@
|
|||
<template lang="html">
|
||||
<div ref="game"></div>
|
||||
<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>
|
||||
|
|
Reference in a new issue