going on, reactivity is not properly working

This commit is contained in:
2019-07-04 16:02:05 +02:00
parent 503ebf7b6b
commit 5f0e6624e0
4 changed files with 107 additions and 82 deletions

View File

@@ -27,25 +27,22 @@
</header>
<div class="card-content">
<Wealth :wealth="wealth"
:edit="edit_wealth"
@updated="edit_wealth = !edit_wealth">
@updated="console.log('updated wealth')">
</Wealth>
<p class="notification is-warning" v-show="!playerIsGroup">Dette : {{ player.debt }}gp</p>
<a @click="switchPlayerChestVisibility" v-show="!playerIsGroup"
href="#" class="button is-link is-fullwidth">
Coffre
</a>
</div>
<footer class="card-footer">
<a @click="switchPlayerChestVisibility" v-show="!playerIsGroup"
href="#" class="card-footer-item is-dark">
Coffre
</a>
<a @click="edit_wealth = !edit_wealth" href="#" class="card-footer-item">Argent</a>
<a href="#" class="card-footer-item disabled">Historique</a>
</footer>
</div>
<div class="card" v-show="state.show_player_chest" style="margin-top: 1em;">
<div class="card" v-show="state.show_player_chest">
<div class="card-content">
<Chest :player="state.player_id"></Chest>
</div>
</div>
<a href="#" class="button is-link is-fullwidth" disabled>Historique</a>
</div>
</template>
@@ -86,7 +83,11 @@
return this.state.player_list[idx];
},
wealth () {
return [this.player.cp, this.player.sp, this.player.gp, this.player.pp];
const cp = this.player.cp
const sp = this.player.sp
const gp = this.player.gp
const pp = this.player.pp
return [cp, sp, gp, pp];
},
// Check if the active player is the special 'Group' player
playerIsGroup () {