basic impl of players list and loot api in frontend

This commit is contained in:
2019-07-03 16:07:56 +02:00
parent b8968aebbd
commit 4e28eb4159
4 changed files with 46 additions and 29 deletions

View File

@@ -1,9 +1,9 @@
<template>
<main id="app" class="section">
<section id="content" class="columns is-desktop">
<Player></Player>
<Player v-if="fullyLoaded"></Player>
<div class="column">
<Chest :player="0"></Chest>
<Chest :player="0" v-if="fullyLoaded"></Chest>
</div>
</section>
</main>
@@ -32,11 +32,14 @@ function getCookie(cname) {
export default {
name: 'app',
data () { return {
fullyLoaded: false,
};},
components: {
Player,
Chest
},
beforeCreate () {
created () {
const cookie = getCookie("player_id");
let playerId;
if (cookie == "") {
@@ -44,9 +47,9 @@ export default {
} else {
playerId = Number(cookie);
}
AppStorage.initStorage(playerId);
return;
}
AppStorage.initStorage(playerId)
.then(_ => this.fullyLoaded = true);
},
}
</script>