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,
|
"favorite": 0,
|
||||||
"type": "vue",
|
"type": "vue",
|
||||||
"name": "frontend",
|
"name": "frontend",
|
||||||
"openDate": 1556529929207,
|
"openDate": 1556559984890,
|
||||||
"widgets": [
|
"widgets": [
|
||||||
{
|
{
|
||||||
"id": "5sGiztidd",
|
"id": "5sGiztidd",
|
||||||
|
|
|
@ -1,37 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<v-app>
|
<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 />
|
<router-view />
|
||||||
</v-content>
|
|
||||||
</v-app>
|
</v-app>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'App',
|
name: 'App'
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</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">
|
<template lang="html">
|
||||||
<div ref="game"></div>
|
<div ref="game" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'Game',
|
name: 'Game',
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$nextTick(function() {
|
this.$nextTick(function() {
|
||||||
|
try {
|
||||||
// framework
|
// framework
|
||||||
require('craftyjs/dist/crafty')
|
require('craftyjs/dist/crafty')
|
||||||
|
|
||||||
// initialize on ref="game"
|
// initialize on ref="game"
|
||||||
window.Crafty.init(this.$refs.game)
|
window.Crafty.init(this.$refs.game)
|
||||||
|
window.Crafty.stage.fullscreen = true
|
||||||
|
|
||||||
// load fftcg
|
// load fftcg
|
||||||
require('@/crafty/Game.coffee')
|
require('@/crafty/Game.coffee')
|
||||||
|
} catch (e) {
|
||||||
|
window.location.reload()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
beforeDestroy() {
|
||||||
|
window.Crafty.stop(true)
|
||||||
|
delete window.Crafty
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Reference in a new issue