adds show/hides of loot add card

This commit is contained in:
2019-06-15 21:23:22 +02:00
parent fddb5409b4
commit 0ff303475b
2 changed files with 51 additions and 37 deletions

View File

@@ -1,10 +1,13 @@
<template> <template>
<div class="container"> <div class="container">
<button v-if="canAdd" class="button is-medium is-info"> <button v-if="canAdd"
class="button is-medium is-info"
@click="is_adding = true"
v-show="!is_adding">
Nouveau loot Nouveau loot
</button> </button>
<Loot></Loot> <Loot v-if="is_adding" @done="is_adding = false"></Loot>
<table class="table is-fullwidth is-striped" > <table v-else class="table is-fullwidth is-striped" >
<thead> <thead>
<tr> <tr>
<th>Objets de {{ player }}</th> <th>Objets de {{ player }}</th>
@@ -18,10 +21,13 @@
<span class="icon"> <span class="icon">
<i class="fas fa-coins"></i> <i class="fas fa-coins"></i>
</span> </span>
<p v-if="!is_selling">Vendre</p> <p v-if="!is_selling">
<p v-else>{{ totalSellValue ? totalSellValue : 'Annuler' }}</p> Vendre</p>
<p v-else>
{{ totalSellValue ? totalSellValue : 'Annuler' }}</p>
</button> </button>
<PercentInput v-show="is_selling"></PercentInput> <PercentInput v-show="is_selling">
</PercentInput>
</div> </div>
</th> </th>
</tr> </tr>
@@ -94,6 +100,7 @@
sell_value: 80000 }, sell_value: 80000 },
], ],
is_selling: false, is_selling: false,
is_adding: false,
sell_selected: [], sell_selected: [],
}; };
}, },

View File

@@ -2,7 +2,7 @@
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<p class="card-header-title"> <p class="card-header-title">
Nouveau loot</p> Nouveau loot - {{ looted.length }} objet(s)</p>
</div> </div>
<div class="card-content"> <div class="card-content">
<ItemInput @addItem="onAddItem"></ItemInput> <ItemInput @addItem="onAddItem"></ItemInput>
@@ -11,6 +11,10 @@
{{ item }} {{ item }}
</p> </p>
</div> </div>
<div class="card-footer">
<a class="card-footer-item">Confirmer</a>
<a @click="onClose" class="card-footer-item">Annuler</a>
</div>
</div> </div>
</template> </template>
@@ -26,7 +30,10 @@
methods: { methods: {
onAddItem (item) { onAddItem (item) {
this.looted.push(item); this.looted.push(item);
} },
onClose () {
this.$emit('done');
},
} }
} }